@das-fed/ui 7.1.0-dev.28 → 7.1.0-dev.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@das-fed/ui",
|
|
3
|
-
"version": "7.1.0-dev.
|
|
3
|
+
"version": "7.1.0-dev.29",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@antv/x6-plugin-snapline": "^2.1.7",
|
|
27
27
|
"@antv/x6-plugin-transform": "^2.1.8",
|
|
28
28
|
"@antv/x6-vue-shape": "^2.1.2",
|
|
29
|
-
"@das-fed/cli": "7.1.0-dev.
|
|
29
|
+
"@das-fed/cli": "7.1.0-dev.29",
|
|
30
30
|
"@element-plus/icons-vue": "^2.3.1",
|
|
31
31
|
"@types/lodash": "^4.14.194",
|
|
32
32
|
"@types/lodash-es": "^4.17.9",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"vue-tsc": "^2.0.29"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@das-fed/ui": "7.1.0-dev.
|
|
60
|
-
"@das-fed/utils": "7.1.0-dev.
|
|
61
|
-
"@das-fed/web": "7.1.0-dev.
|
|
59
|
+
"@das-fed/ui": "7.1.0-dev.29",
|
|
60
|
+
"@das-fed/utils": "7.1.0-dev.29",
|
|
61
|
+
"@das-fed/web": "7.1.0-dev.29",
|
|
62
62
|
"@types/markdown-it": "^14.1.2",
|
|
63
63
|
"@wangeditor-next/editor": "5.6.31",
|
|
64
64
|
"@wangeditor-next/editor-for-vue": "5.1.14",
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import '@das-fed/ui/packages/business-components/change-pwd/style.css';
|
|
2
|
-
import { ref as
|
|
3
|
-
import { withInstall as
|
|
4
|
-
import { t as d, i18n as
|
|
5
|
-
import { DasDialog as
|
|
6
|
-
import { DasFormRef as
|
|
7
|
-
import { DasFormItem as
|
|
8
|
-
import { DasButton as
|
|
9
|
-
import { DasMessage as
|
|
10
|
-
import { enterpriseright as
|
|
11
|
-
import { encryption as
|
|
12
|
-
const
|
|
2
|
+
import { ref as b, reactive as I, defineComponent as O, createBlock as V, openBlock as A, unref as t, isRef as $, withCtx as C, createElementVNode as S, createVNode as y, createCommentVNode as Z, createTextVNode as x, toDisplayString as E } from "vue";
|
|
3
|
+
import { withInstall as W } from "@das-fed/utils/with-install/index";
|
|
4
|
+
import { t as d, i18n as D, setI18nRule as j } from "@das-fed/web/packages/i18n/index";
|
|
5
|
+
import { DasDialog as G } from "@das-fed/ui/packages/components/dialog/index";
|
|
6
|
+
import { DasFormRef as H, DasForm as X } from "@das-fed/ui/packages/components/form/index";
|
|
7
|
+
import { DasFormItem as q } from "@das-fed/ui/packages/components/form-item/index";
|
|
8
|
+
import { DasButton as U } from "@das-fed/ui/packages/components/button/index";
|
|
9
|
+
import { DasMessage as Y } from "@das-fed/ui/packages/components/message/index";
|
|
10
|
+
import { enterpriseright as z, superadminPortal as J, systemConfiguration as Q, justauth as ee } from "@das-fed/utils/api-services/modules";
|
|
11
|
+
import { encryption as v } from "@das-fed/utils/atob";
|
|
12
|
+
const M = z.get("/user/change-pwd", (r) => (r.ignoreErrorMessage = !0, r)), K = z.put("/user/change-pwd", (r) => (r.csrf = !0, r)), re = J.put("/change-pwd"), te = Q.get("/visitor/login/with-default"), ne = "RSA_V1:", ae = async (r) => {
|
|
13
13
|
const n = window.atob(r), p = new Uint8Array(n.length);
|
|
14
14
|
for (let a = 0; a < n.length; a++)
|
|
15
15
|
p[a] = n.charCodeAt(a);
|
|
16
16
|
return window.crypto.subtle.importKey("spki", p.buffer, { name: "RSA-OAEP", hash: "SHA-256" }, !1, ["encrypt"]);
|
|
17
|
-
},
|
|
17
|
+
}, oe = (r) => {
|
|
18
18
|
let n = "";
|
|
19
19
|
const p = new Uint8Array(r);
|
|
20
20
|
for (let a = 0; a < p.byteLength; a++)
|
|
21
21
|
n += String.fromCharCode(p[a]);
|
|
22
22
|
return window.btoa(n);
|
|
23
|
-
},
|
|
23
|
+
}, se = async (r) => {
|
|
24
24
|
try {
|
|
25
25
|
const n = await r();
|
|
26
26
|
if (!n.trim())
|
|
27
|
-
return async (a) =>
|
|
28
|
-
const p = await
|
|
27
|
+
return async (a) => v(a);
|
|
28
|
+
const p = await ae(n);
|
|
29
29
|
return async (a) => {
|
|
30
30
|
try {
|
|
31
31
|
const l = await window.crypto.subtle.encrypt(
|
|
@@ -33,25 +33,25 @@ const D = q.get("/user/change-pwd", (r) => (r.ignoreErrorMessage = !0, r)), U =
|
|
|
33
33
|
p,
|
|
34
34
|
new TextEncoder().encode(a)
|
|
35
35
|
);
|
|
36
|
-
return
|
|
36
|
+
return ne + oe(l);
|
|
37
37
|
} catch {
|
|
38
|
-
return
|
|
38
|
+
return v(a);
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
} catch {
|
|
42
|
-
return async (n) =>
|
|
42
|
+
return async (n) => v(n);
|
|
43
43
|
}
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
const [r, n] = await
|
|
44
|
+
}, ie = z.get("/visitor/rsa/public-key", (r) => (r.ignoreErrorMessage = !0, r));
|
|
45
|
+
ee.get("/rsa/public-key", (r) => (r.ignoreErrorMessage = !0, r));
|
|
46
|
+
const pe = async () => {
|
|
47
|
+
const [r, n] = await ie().run();
|
|
48
48
|
return r || !n ? "" : typeof n.publicKey == "string" ? n.publicKey : "";
|
|
49
|
-
},
|
|
50
|
-
const p =
|
|
49
|
+
}, de = (r, n) => {
|
|
50
|
+
const p = b(!1), a = H(), l = b({
|
|
51
51
|
prePwd: "",
|
|
52
52
|
pwd: "",
|
|
53
53
|
confirmPwd: ""
|
|
54
|
-
}), o =
|
|
54
|
+
}), o = I({
|
|
55
55
|
pwdStrongLimit: !1,
|
|
56
56
|
// 是否开启密码强度校验
|
|
57
57
|
pwdRequireLength: !1,
|
|
@@ -66,29 +66,29 @@ const oe = async () => {
|
|
|
66
66
|
// 密码要求包含大写字母
|
|
67
67
|
pwdRequireSpecialCharacter: !1
|
|
68
68
|
// 密码要求特殊字符
|
|
69
|
-
}),
|
|
70
|
-
const [s, e] = await
|
|
69
|
+
}), _ = async () => {
|
|
70
|
+
const [s, e] = await te().run();
|
|
71
71
|
s || (o.pwdStrongLimit = e.pwdStrongLimit, o.pwdRequireLength = e.pwdRequireLength, o.pwdMinLength = e.pwdMinLength, o.pwdRequireNum = e.pwdRequireNum, o.pwdRequireLowercaseLetters = e.pwdRequireLowercaseLetters, o.pwdRequireUppercaseLetters = e.pwdRequireUppercaseLetters, o.pwdRequireSpecialCharacter = e.pwdRequireSpecialCharacter);
|
|
72
|
-
},
|
|
72
|
+
}, w = (s) => {
|
|
73
73
|
let e = "";
|
|
74
|
-
return o.pwdStrongLimit ? e =
|
|
75
|
-
},
|
|
76
|
-
var
|
|
74
|
+
return o.pwdStrongLimit ? e = F(s) : e = c(s), e;
|
|
75
|
+
}, L = (s, e, i) => {
|
|
76
|
+
var m;
|
|
77
77
|
if (!e) return i(new Error(d("新密码不能为空")));
|
|
78
78
|
if (r.mainApp === "enterpriseadmin") {
|
|
79
|
-
const
|
|
80
|
-
if ((
|
|
79
|
+
const h = w(e);
|
|
80
|
+
if ((m = a.value) == null || m.validateField("confirmPwd", () => null), h) return i(new Error(h));
|
|
81
81
|
}
|
|
82
82
|
i();
|
|
83
|
-
},
|
|
83
|
+
}, N = (s, e, i) => {
|
|
84
84
|
if (!e) return i(new Error(d("确认密码不能为空")));
|
|
85
85
|
if (l.value.pwd !== e) return i(new Error(d("与新密码不一致")));
|
|
86
86
|
if (r.mainApp === "enterpriseadmin") {
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
87
|
+
const m = w(e);
|
|
88
|
+
if (m) return i(new Error(m));
|
|
89
89
|
}
|
|
90
90
|
i();
|
|
91
|
-
},
|
|
91
|
+
}, R = b({
|
|
92
92
|
prePwd: [
|
|
93
93
|
{
|
|
94
94
|
required: !r.forceUpdate,
|
|
@@ -96,88 +96,92 @@ const oe = async () => {
|
|
|
96
96
|
trigger: "blur"
|
|
97
97
|
}
|
|
98
98
|
],
|
|
99
|
-
pwd: [{ validator:
|
|
100
|
-
confirmPwd: [{ validator:
|
|
101
|
-
}), g =
|
|
102
|
-
r.mainApp === "enterpriseadmin" &&
|
|
103
|
-
},
|
|
99
|
+
pwd: [{ validator: L, trigger: "blur" }],
|
|
100
|
+
confirmPwd: [{ validator: N, trigger: "blur" }]
|
|
101
|
+
}), g = b(""), k = (s) => {
|
|
102
|
+
r.mainApp === "enterpriseadmin" && _(), p.value = !0, g.value = s || "";
|
|
103
|
+
}, u = (s = !1) => {
|
|
104
104
|
var e;
|
|
105
105
|
l.value.prePwd = "", l.value.pwd = "", l.value.confirmPwd = "", (e = a.value) == null || e.resetField(), p.value = !1, s || n("onCancel");
|
|
106
|
-
},
|
|
106
|
+
}, c = (s) => {
|
|
107
107
|
const e = d("das-ui-business-components-change-pwd-passwordFormatRule");
|
|
108
108
|
return /^(?=.*[a-zA-Z])(?=.*[\d])(?=.*[\w])[a-zA-Z\d\W_]{8,20}$/.test(s) ? "" : e;
|
|
109
|
-
},
|
|
109
|
+
}, F = (s) => {
|
|
110
110
|
let e = "", i = !1;
|
|
111
111
|
e += d("das-ui-business-components-change-pwd-limit-number", o.pwdMinLength);
|
|
112
|
-
const
|
|
113
|
-
return new RegExp(
|
|
112
|
+
const m = `\\S{${o.pwdMinLength},}`;
|
|
113
|
+
return new RegExp(m).test(s) || (i = !0), (o.pwdRequireNum || o.pwdRequireLowercaseLetters || o.pwdRequireUppercaseLetters || o.pwdRequireSpecialCharacter) && (e += d("必须包含")), o.pwdRequireNum && (e += d("数字,"), /\d+/.test(s) || (i = !0)), o.pwdRequireLowercaseLetters && (e += d("小写字母,"), /[a-z]+/.test(s) || (i = !0)), o.pwdRequireUppercaseLetters && (e += d("大写字母,"), /[A-Z]+/.test(s) || (i = !0)), o.pwdRequireSpecialCharacter && (e += d("符号,"), /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~]+/.test(s) || (i = !0)), i ? e.slice(0, -1) : "";
|
|
114
114
|
};
|
|
115
115
|
return {
|
|
116
116
|
visible: p,
|
|
117
117
|
formData: l,
|
|
118
118
|
form: a,
|
|
119
|
-
rules:
|
|
120
|
-
openDialog:
|
|
121
|
-
onCancel:
|
|
119
|
+
rules: R,
|
|
120
|
+
openDialog: k,
|
|
121
|
+
onCancel: u,
|
|
122
122
|
onConfirm: async () => {
|
|
123
123
|
var s;
|
|
124
124
|
(s = a.value) == null || s.validate(async (e) => {
|
|
125
|
-
const i = await
|
|
125
|
+
const i = await se(pe), [m, h, T] = await Promise.all([
|
|
126
|
+
i(l.value.pwd),
|
|
127
|
+
i(l.value.confirmPwd),
|
|
128
|
+
i(l.value.prePwd)
|
|
129
|
+
]);
|
|
126
130
|
if (e) {
|
|
127
|
-
const
|
|
128
|
-
pwd:
|
|
129
|
-
confirmPwd:
|
|
131
|
+
const P = {
|
|
132
|
+
pwd: m,
|
|
133
|
+
confirmPwd: h
|
|
130
134
|
};
|
|
131
135
|
if (r.mainApp === "enterpriseadmin" && r.forceUpdate) {
|
|
132
|
-
let
|
|
133
|
-
g.value && (
|
|
134
|
-
const [
|
|
135
|
-
if (
|
|
136
|
-
} else if (
|
|
137
|
-
await
|
|
138
|
-
const [
|
|
139
|
-
if (
|
|
136
|
+
let f = {};
|
|
137
|
+
g.value && (f = { headers: { Authorization: g.value } }), await M({}, f).run();
|
|
138
|
+
const [B] = await K({}, f).run(P);
|
|
139
|
+
if (B) return;
|
|
140
|
+
} else if (P.prePwd = T, r.mainApp === "enterpriseadmin") {
|
|
141
|
+
await M().run();
|
|
142
|
+
const [f] = await K().run(P);
|
|
143
|
+
if (f) return;
|
|
140
144
|
} else {
|
|
141
|
-
const [
|
|
142
|
-
if (
|
|
145
|
+
const [f] = await re().run(P);
|
|
146
|
+
if (f) return;
|
|
143
147
|
}
|
|
144
|
-
|
|
148
|
+
u(!0), Y.success(d("修改密码成功!")), n("onConfirm");
|
|
145
149
|
}
|
|
146
150
|
});
|
|
147
151
|
}
|
|
148
152
|
};
|
|
149
|
-
},
|
|
153
|
+
}, le = { class: "dialog-content" }, ue = {
|
|
150
154
|
name: "ChangePwd"
|
|
151
|
-
},
|
|
152
|
-
...
|
|
155
|
+
}, we = /* @__PURE__ */ O({
|
|
156
|
+
...ue,
|
|
153
157
|
props: {
|
|
154
158
|
mainApp: { default: "enterpriseadmin" },
|
|
155
159
|
forceUpdate: { type: Boolean }
|
|
156
160
|
},
|
|
157
161
|
emits: ["onCancel", "onConfirm"],
|
|
158
162
|
setup(r, { expose: n, emit: p }) {
|
|
159
|
-
const a = r, l = p, { visible: o, form:
|
|
163
|
+
const a = r, l = p, { visible: o, form: _, formData: w, rules: L, openDialog: N, onCancel: R, onConfirm: g } = de(a, l);
|
|
160
164
|
return n({
|
|
161
|
-
openDialog:
|
|
162
|
-
}), (
|
|
165
|
+
openDialog: N
|
|
166
|
+
}), (k, u) => (A(), V(t(G), {
|
|
163
167
|
title: t(d)("修改密码"),
|
|
164
168
|
width: "460px",
|
|
165
169
|
height: "360px",
|
|
166
170
|
bodyStyle: { padding: 0 },
|
|
167
171
|
modelValue: t(o),
|
|
168
|
-
"onUpdate:modelValue":
|
|
169
|
-
"before-close": t(
|
|
172
|
+
"onUpdate:modelValue": u[3] || (u[3] = (c) => $(o) ? o.value = c : null),
|
|
173
|
+
"before-close": t(R)
|
|
170
174
|
}, {
|
|
171
|
-
footer:
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
footer: C(() => [
|
|
176
|
+
S("div", null, [
|
|
177
|
+
y(t(U), {
|
|
174
178
|
size: "middle",
|
|
175
179
|
style: { "margin-right": "12px" },
|
|
176
|
-
onClick: t(
|
|
180
|
+
onClick: t(R)
|
|
177
181
|
}, {
|
|
178
|
-
default:
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
default: C(() => [
|
|
183
|
+
x(
|
|
184
|
+
E(t(D)("取消").value),
|
|
181
185
|
1
|
|
182
186
|
/* TEXT */
|
|
183
187
|
)
|
|
@@ -185,14 +189,14 @@ const oe = async () => {
|
|
|
185
189
|
_: 1
|
|
186
190
|
/* STABLE */
|
|
187
191
|
}, 8, ["onClick"]),
|
|
188
|
-
|
|
192
|
+
y(t(U), {
|
|
189
193
|
btnType: "primary",
|
|
190
194
|
size: "middle",
|
|
191
195
|
onClick: t(g)
|
|
192
196
|
}, {
|
|
193
|
-
default:
|
|
194
|
-
|
|
195
|
-
|
|
197
|
+
default: C(() => [
|
|
198
|
+
x(
|
|
199
|
+
E(t(D)("确定").value),
|
|
196
200
|
1
|
|
197
201
|
/* TEXT */
|
|
198
202
|
)
|
|
@@ -202,16 +206,16 @@ const oe = async () => {
|
|
|
202
206
|
}, 8, ["onClick"])
|
|
203
207
|
])
|
|
204
208
|
]),
|
|
205
|
-
default:
|
|
206
|
-
|
|
207
|
-
|
|
209
|
+
default: C(() => [
|
|
210
|
+
S("div", le, [
|
|
211
|
+
y(t(X), {
|
|
208
212
|
ref_key: "form",
|
|
209
|
-
ref:
|
|
210
|
-
rules: t(
|
|
213
|
+
ref: _,
|
|
214
|
+
rules: t(L),
|
|
211
215
|
style: { "overflow-x": "hidden !important" }
|
|
212
216
|
}, {
|
|
213
|
-
default:
|
|
214
|
-
|
|
217
|
+
default: C(() => [
|
|
218
|
+
k.forceUpdate ? Z("v-if", !0) : (A(), V(t(q), {
|
|
215
219
|
key: 0,
|
|
216
220
|
type: "password",
|
|
217
221
|
isTitle: !1,
|
|
@@ -219,34 +223,34 @@ const oe = async () => {
|
|
|
219
223
|
"show-password": "",
|
|
220
224
|
prop: "prePwd",
|
|
221
225
|
label: t(d)("旧密码"),
|
|
222
|
-
modelValue: t(
|
|
223
|
-
"onUpdate:modelValue":
|
|
226
|
+
modelValue: t(w).prePwd,
|
|
227
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => t(w).prePwd = c),
|
|
224
228
|
modelModifiers: { trim: !0 },
|
|
225
229
|
maxlength: 20,
|
|
226
230
|
required: ""
|
|
227
231
|
}, null, 8, ["label", "modelValue"])),
|
|
228
|
-
|
|
232
|
+
y(t(q), {
|
|
229
233
|
type: "password",
|
|
230
234
|
isTitle: !1,
|
|
231
235
|
autocomplete: "new-password",
|
|
232
236
|
"show-password": "",
|
|
233
237
|
prop: "pwd",
|
|
234
238
|
label: t(d)("新密码"),
|
|
235
|
-
modelValue: t(
|
|
236
|
-
"onUpdate:modelValue":
|
|
239
|
+
modelValue: t(w).pwd,
|
|
240
|
+
"onUpdate:modelValue": u[1] || (u[1] = (c) => t(w).pwd = c),
|
|
237
241
|
modelModifiers: { trim: !0 },
|
|
238
242
|
maxlength: 20,
|
|
239
243
|
required: ""
|
|
240
244
|
}, null, 8, ["label", "modelValue"]),
|
|
241
|
-
|
|
245
|
+
y(t(q), {
|
|
242
246
|
type: "password",
|
|
243
247
|
isTitle: !1,
|
|
244
248
|
autocomplete: "new-password",
|
|
245
249
|
"show-password": "",
|
|
246
250
|
prop: "confirmPwd",
|
|
247
251
|
label: t(d)("确认新密码"),
|
|
248
|
-
modelValue: t(
|
|
249
|
-
"onUpdate:modelValue":
|
|
252
|
+
modelValue: t(w).confirmPwd,
|
|
253
|
+
"onUpdate:modelValue": u[2] || (u[2] = (c) => t(w).confirmPwd = c),
|
|
250
254
|
modelModifiers: { trim: !0 },
|
|
251
255
|
maxlength: 20,
|
|
252
256
|
required: ""
|
|
@@ -261,12 +265,12 @@ const oe = async () => {
|
|
|
261
265
|
/* STABLE */
|
|
262
266
|
}, 8, ["title", "modelValue", "before-close"]));
|
|
263
267
|
}
|
|
264
|
-
}),
|
|
268
|
+
}), ce = (r, n) => {
|
|
265
269
|
const p = r.__vccOpts || r;
|
|
266
270
|
for (const [a, l] of n)
|
|
267
271
|
p[a] = l;
|
|
268
272
|
return p;
|
|
269
|
-
},
|
|
273
|
+
}, me = /* @__PURE__ */ ce(we, [["__scopeId", "data-v-901c1af6"]]), fe = {
|
|
270
274
|
新密码不能为空: { "zh-CN": "新密码不能为空", en: "New password cannot be empty", _appCode: "framework" },
|
|
271
275
|
确认密码不能为空: { "zh-CN": "确认密码不能为空", en: "Confirm password cannot be empty", _appCode: "framework" },
|
|
272
276
|
与新密码不一致: { "zh-CN": "与新密码不一致", en: "Doesn't match the new password", _appCode: "framework" },
|
|
@@ -298,9 +302,9 @@ const oe = async () => {
|
|
|
298
302
|
_appCode: "framework"
|
|
299
303
|
}
|
|
300
304
|
};
|
|
301
|
-
|
|
302
|
-
const
|
|
305
|
+
j(fe);
|
|
306
|
+
const qe = W(me), ve = () => b(null);
|
|
303
307
|
export {
|
|
304
|
-
|
|
305
|
-
|
|
308
|
+
qe as DasChangePwd,
|
|
309
|
+
ve as DasChangePwdRef
|
|
306
310
|
};
|
|
Binary file
|