@das-fed/ui 7.1.0-dev.26 → 7.1.0-dev.28
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 +5 -5
- package/packages/business-components/change-pwd/index.js +160 -122
- package/packages/business-components/change-pwd/index.js.gz +0 -0
- package/packages/business-components/change-pwd/src/get-public-key.d.ts +10 -0
- package/packages/business-components/change-pwd/src/password-encryption.d.ts +8 -0
- package/packages/business-components/device-panel/index.js +450 -446
- package/packages/business-components/device-panel/index.js.gz +0 -0
- package/packages/business-components/device-panel/style.css +1 -1
- package/packages/business-components/device-panel/style.css.gz +0 -0
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.28",
|
|
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.28",
|
|
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.28",
|
|
60
|
+
"@das-fed/utils": "7.1.0-dev.28",
|
|
61
|
+
"@das-fed/web": "7.1.0-dev.28",
|
|
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,20 +1,57 @@
|
|
|
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
|
|
2
|
+
import { ref as y, reactive as F, defineComponent as T, createBlock as v, openBlock as z, unref as t, isRef as B, withCtx as h, createElementVNode as V, createVNode as C, createCommentVNode as I, createTextVNode as A, toDisplayString as S } from "vue";
|
|
3
|
+
import { withInstall as O } from "@das-fed/utils/with-install/index";
|
|
4
|
+
import { t as d, i18n as x, setI18nRule as $ } from "@das-fed/web/packages/i18n/index";
|
|
5
5
|
import { DasDialog as Z } from "@das-fed/ui/packages/components/dialog/index";
|
|
6
|
-
import { DasFormRef as W, DasForm as
|
|
7
|
-
import { DasFormItem as
|
|
8
|
-
import { DasButton as
|
|
9
|
-
import { DasMessage as
|
|
10
|
-
import { enterpriseright as
|
|
6
|
+
import { DasFormRef as W, DasForm as j } from "@das-fed/ui/packages/components/form/index";
|
|
7
|
+
import { DasFormItem as N } from "@das-fed/ui/packages/components/form-item/index";
|
|
8
|
+
import { DasButton as E } from "@das-fed/ui/packages/components/button/index";
|
|
9
|
+
import { DasMessage as G } from "@das-fed/ui/packages/components/message/index";
|
|
10
|
+
import { enterpriseright as q, superadminPortal as H, systemConfiguration as X, justauth as Y } from "@das-fed/utils/api-services/modules";
|
|
11
11
|
import { encryption as k } from "@das-fed/utils/atob";
|
|
12
|
-
const
|
|
13
|
-
const
|
|
12
|
+
const D = q.get("/user/change-pwd", (r) => (r.ignoreErrorMessage = !0, r)), U = q.put("/user/change-pwd", (r) => (r.csrf = !0, r)), J = H.put("/change-pwd"), Q = X.get("/visitor/login/with-default"), ee = "RSA_V1:", re = async (r) => {
|
|
13
|
+
const n = window.atob(r), p = new Uint8Array(n.length);
|
|
14
|
+
for (let a = 0; a < n.length; a++)
|
|
15
|
+
p[a] = n.charCodeAt(a);
|
|
16
|
+
return window.crypto.subtle.importKey("spki", p.buffer, { name: "RSA-OAEP", hash: "SHA-256" }, !1, ["encrypt"]);
|
|
17
|
+
}, te = (r) => {
|
|
18
|
+
let n = "";
|
|
19
|
+
const p = new Uint8Array(r);
|
|
20
|
+
for (let a = 0; a < p.byteLength; a++)
|
|
21
|
+
n += String.fromCharCode(p[a]);
|
|
22
|
+
return window.btoa(n);
|
|
23
|
+
}, ne = async (r) => {
|
|
24
|
+
try {
|
|
25
|
+
const n = await r();
|
|
26
|
+
if (!n.trim())
|
|
27
|
+
return async (a) => k(a);
|
|
28
|
+
const p = await re(n);
|
|
29
|
+
return async (a) => {
|
|
30
|
+
try {
|
|
31
|
+
const l = await window.crypto.subtle.encrypt(
|
|
32
|
+
{ name: "RSA-OAEP" },
|
|
33
|
+
p,
|
|
34
|
+
new TextEncoder().encode(a)
|
|
35
|
+
);
|
|
36
|
+
return ee + te(l);
|
|
37
|
+
} catch {
|
|
38
|
+
return k(a);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
} catch {
|
|
42
|
+
return async (n) => k(n);
|
|
43
|
+
}
|
|
44
|
+
}, ae = q.get("/visitor/rsa/public-key", (r) => (r.ignoreErrorMessage = !0, r));
|
|
45
|
+
Y.get("/rsa/public-key", (r) => (r.ignoreErrorMessage = !0, r));
|
|
46
|
+
const oe = async () => {
|
|
47
|
+
const [r, n] = await ae().run();
|
|
48
|
+
return r || !n ? "" : typeof n.publicKey == "string" ? n.publicKey : "";
|
|
49
|
+
}, se = (r, n) => {
|
|
50
|
+
const p = y(!1), a = W(), l = y({
|
|
14
51
|
prePwd: "",
|
|
15
52
|
pwd: "",
|
|
16
53
|
confirmPwd: ""
|
|
17
|
-
}),
|
|
54
|
+
}), o = F({
|
|
18
55
|
pwdStrongLimit: !1,
|
|
19
56
|
// 是否开启密码强度校验
|
|
20
57
|
pwdRequireLength: !1,
|
|
@@ -29,117 +66,118 @@ const S = M.get("/user/change-pwd", (n) => (n.ignoreErrorMessage = !0, n)), A =
|
|
|
29
66
|
// 密码要求包含大写字母
|
|
30
67
|
pwdRequireSpecialCharacter: !1
|
|
31
68
|
// 密码要求特殊字符
|
|
32
|
-
}),
|
|
33
|
-
const [
|
|
34
|
-
|
|
35
|
-
},
|
|
69
|
+
}), R = async () => {
|
|
70
|
+
const [s, e] = await Q().run();
|
|
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
|
+
}, m = (s) => {
|
|
36
73
|
let e = "";
|
|
37
|
-
return
|
|
38
|
-
},
|
|
39
|
-
var
|
|
40
|
-
if (!e) return
|
|
41
|
-
if (
|
|
42
|
-
const
|
|
43
|
-
if ((
|
|
74
|
+
return o.pwdStrongLimit ? e = M(s) : e = f(s), e;
|
|
75
|
+
}, P = (s, e, i) => {
|
|
76
|
+
var u;
|
|
77
|
+
if (!e) return i(new Error(d("新密码不能为空")));
|
|
78
|
+
if (r.mainApp === "enterpriseadmin") {
|
|
79
|
+
const c = m(e);
|
|
80
|
+
if ((u = a.value) == null || u.validateField("confirmPwd", () => null), c) return i(new Error(c));
|
|
44
81
|
}
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
if (!e) return
|
|
48
|
-
if (
|
|
49
|
-
if (
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
82
|
+
i();
|
|
83
|
+
}, _ = (s, e, i) => {
|
|
84
|
+
if (!e) return i(new Error(d("确认密码不能为空")));
|
|
85
|
+
if (l.value.pwd !== e) return i(new Error(d("与新密码不一致")));
|
|
86
|
+
if (r.mainApp === "enterpriseadmin") {
|
|
87
|
+
const u = m(e);
|
|
88
|
+
if (u) return i(new Error(u));
|
|
52
89
|
}
|
|
53
|
-
|
|
54
|
-
},
|
|
90
|
+
i();
|
|
91
|
+
}, b = y({
|
|
55
92
|
prePwd: [
|
|
56
93
|
{
|
|
57
|
-
required: !
|
|
58
|
-
message:
|
|
94
|
+
required: !r.forceUpdate,
|
|
95
|
+
message: d("旧密码不能为空"),
|
|
59
96
|
trigger: "blur"
|
|
60
97
|
}
|
|
61
98
|
],
|
|
62
|
-
pwd: [{ validator:
|
|
63
|
-
confirmPwd: [{ validator:
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
},
|
|
99
|
+
pwd: [{ validator: P, trigger: "blur" }],
|
|
100
|
+
confirmPwd: [{ validator: _, trigger: "blur" }]
|
|
101
|
+
}), g = y(""), L = (s) => {
|
|
102
|
+
r.mainApp === "enterpriseadmin" && R(), p.value = !0, g.value = s || "";
|
|
103
|
+
}, w = (s = !1) => {
|
|
67
104
|
var e;
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
const e =
|
|
71
|
-
return /^(?=.*[a-zA-Z])(?=.*[\d])(?=.*[\w])[a-zA-Z\d\W_]{8,20}$/.test(
|
|
72
|
-
},
|
|
73
|
-
let e = "",
|
|
74
|
-
e +=
|
|
75
|
-
const
|
|
76
|
-
return new RegExp(
|
|
105
|
+
l.value.prePwd = "", l.value.pwd = "", l.value.confirmPwd = "", (e = a.value) == null || e.resetField(), p.value = !1, s || n("onCancel");
|
|
106
|
+
}, f = (s) => {
|
|
107
|
+
const e = d("das-ui-business-components-change-pwd-passwordFormatRule");
|
|
108
|
+
return /^(?=.*[a-zA-Z])(?=.*[\d])(?=.*[\w])[a-zA-Z\d\W_]{8,20}$/.test(s) ? "" : e;
|
|
109
|
+
}, M = (s) => {
|
|
110
|
+
let e = "", i = !1;
|
|
111
|
+
e += d("das-ui-business-components-change-pwd-limit-number", o.pwdMinLength);
|
|
112
|
+
const u = `\\S{${o.pwdMinLength},}`;
|
|
113
|
+
return new RegExp(u).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) : "";
|
|
77
114
|
};
|
|
78
115
|
return {
|
|
79
|
-
visible:
|
|
80
|
-
formData:
|
|
81
|
-
form:
|
|
82
|
-
rules:
|
|
83
|
-
openDialog:
|
|
84
|
-
onCancel:
|
|
116
|
+
visible: p,
|
|
117
|
+
formData: l,
|
|
118
|
+
form: a,
|
|
119
|
+
rules: b,
|
|
120
|
+
openDialog: L,
|
|
121
|
+
onCancel: w,
|
|
85
122
|
onConfirm: async () => {
|
|
86
|
-
var
|
|
87
|
-
(
|
|
123
|
+
var s;
|
|
124
|
+
(s = a.value) == null || s.validate(async (e) => {
|
|
125
|
+
const i = await ne(oe);
|
|
88
126
|
if (e) {
|
|
89
|
-
const
|
|
90
|
-
pwd:
|
|
91
|
-
confirmPwd:
|
|
127
|
+
const u = {
|
|
128
|
+
pwd: i(l.value.pwd),
|
|
129
|
+
confirmPwd: i(l.value.confirmPwd)
|
|
92
130
|
};
|
|
93
|
-
if (
|
|
94
|
-
let
|
|
95
|
-
|
|
96
|
-
const [
|
|
97
|
-
if (
|
|
98
|
-
} else if (
|
|
99
|
-
await
|
|
100
|
-
const [
|
|
101
|
-
if (
|
|
131
|
+
if (r.mainApp === "enterpriseadmin" && r.forceUpdate) {
|
|
132
|
+
let c = {};
|
|
133
|
+
g.value && (c = { headers: { Authorization: g.value } }), await D({}, c).run();
|
|
134
|
+
const [K] = await U({}, c).run(u);
|
|
135
|
+
if (K) return;
|
|
136
|
+
} else if (u.prePwd = i(l.value.prePwd), r.mainApp === "enterpriseadmin") {
|
|
137
|
+
await D().run();
|
|
138
|
+
const [c] = await U().run(u);
|
|
139
|
+
if (c) return;
|
|
102
140
|
} else {
|
|
103
|
-
const [
|
|
104
|
-
if (
|
|
141
|
+
const [c] = await J().run(u);
|
|
142
|
+
if (c) return;
|
|
105
143
|
}
|
|
106
|
-
|
|
144
|
+
w(!0), G.success(d("修改密码成功!")), n("onConfirm");
|
|
107
145
|
}
|
|
108
146
|
});
|
|
109
147
|
}
|
|
110
148
|
};
|
|
111
|
-
},
|
|
149
|
+
}, ie = { class: "dialog-content" }, pe = {
|
|
112
150
|
name: "ChangePwd"
|
|
113
|
-
},
|
|
114
|
-
...
|
|
151
|
+
}, de = /* @__PURE__ */ T({
|
|
152
|
+
...pe,
|
|
115
153
|
props: {
|
|
116
154
|
mainApp: { default: "enterpriseadmin" },
|
|
117
155
|
forceUpdate: { type: Boolean }
|
|
118
156
|
},
|
|
119
157
|
emits: ["onCancel", "onConfirm"],
|
|
120
|
-
setup(
|
|
121
|
-
const
|
|
122
|
-
return
|
|
123
|
-
openDialog:
|
|
124
|
-
}), (
|
|
125
|
-
title:
|
|
158
|
+
setup(r, { expose: n, emit: p }) {
|
|
159
|
+
const a = r, l = p, { visible: o, form: R, formData: m, rules: P, openDialog: _, onCancel: b, onConfirm: g } = se(a, l);
|
|
160
|
+
return n({
|
|
161
|
+
openDialog: _
|
|
162
|
+
}), (L, w) => (z(), v(t(Z), {
|
|
163
|
+
title: t(d)("修改密码"),
|
|
126
164
|
width: "460px",
|
|
127
165
|
height: "360px",
|
|
128
166
|
bodyStyle: { padding: 0 },
|
|
129
|
-
modelValue:
|
|
130
|
-
"onUpdate:modelValue":
|
|
131
|
-
"before-close":
|
|
167
|
+
modelValue: t(o),
|
|
168
|
+
"onUpdate:modelValue": w[3] || (w[3] = (f) => B(o) ? o.value = f : null),
|
|
169
|
+
"before-close": t(b)
|
|
132
170
|
}, {
|
|
133
|
-
footer:
|
|
134
|
-
|
|
135
|
-
|
|
171
|
+
footer: h(() => [
|
|
172
|
+
V("div", null, [
|
|
173
|
+
C(t(E), {
|
|
136
174
|
size: "middle",
|
|
137
175
|
style: { "margin-right": "12px" },
|
|
138
|
-
onClick:
|
|
176
|
+
onClick: t(b)
|
|
139
177
|
}, {
|
|
140
|
-
default:
|
|
141
|
-
|
|
142
|
-
|
|
178
|
+
default: h(() => [
|
|
179
|
+
A(
|
|
180
|
+
S(t(x)("取消").value),
|
|
143
181
|
1
|
|
144
182
|
/* TEXT */
|
|
145
183
|
)
|
|
@@ -147,14 +185,14 @@ const S = M.get("/user/change-pwd", (n) => (n.ignoreErrorMessage = !0, n)), A =
|
|
|
147
185
|
_: 1
|
|
148
186
|
/* STABLE */
|
|
149
187
|
}, 8, ["onClick"]),
|
|
150
|
-
|
|
188
|
+
C(t(E), {
|
|
151
189
|
btnType: "primary",
|
|
152
190
|
size: "middle",
|
|
153
|
-
onClick:
|
|
191
|
+
onClick: t(g)
|
|
154
192
|
}, {
|
|
155
|
-
default:
|
|
156
|
-
|
|
157
|
-
|
|
193
|
+
default: h(() => [
|
|
194
|
+
A(
|
|
195
|
+
S(t(x)("确定").value),
|
|
158
196
|
1
|
|
159
197
|
/* TEXT */
|
|
160
198
|
)
|
|
@@ -164,51 +202,51 @@ const S = M.get("/user/change-pwd", (n) => (n.ignoreErrorMessage = !0, n)), A =
|
|
|
164
202
|
}, 8, ["onClick"])
|
|
165
203
|
])
|
|
166
204
|
]),
|
|
167
|
-
default:
|
|
168
|
-
|
|
169
|
-
|
|
205
|
+
default: h(() => [
|
|
206
|
+
V("div", ie, [
|
|
207
|
+
C(t(j), {
|
|
170
208
|
ref_key: "form",
|
|
171
|
-
ref:
|
|
172
|
-
rules:
|
|
209
|
+
ref: R,
|
|
210
|
+
rules: t(P),
|
|
173
211
|
style: { "overflow-x": "hidden !important" }
|
|
174
212
|
}, {
|
|
175
|
-
default:
|
|
176
|
-
|
|
213
|
+
default: h(() => [
|
|
214
|
+
L.forceUpdate ? I("v-if", !0) : (z(), v(t(N), {
|
|
177
215
|
key: 0,
|
|
178
216
|
type: "password",
|
|
179
217
|
isTitle: !1,
|
|
180
218
|
autocomplete: "new-password",
|
|
181
219
|
"show-password": "",
|
|
182
220
|
prop: "prePwd",
|
|
183
|
-
label:
|
|
184
|
-
modelValue:
|
|
185
|
-
"onUpdate:modelValue":
|
|
221
|
+
label: t(d)("旧密码"),
|
|
222
|
+
modelValue: t(m).prePwd,
|
|
223
|
+
"onUpdate:modelValue": w[0] || (w[0] = (f) => t(m).prePwd = f),
|
|
186
224
|
modelModifiers: { trim: !0 },
|
|
187
225
|
maxlength: 20,
|
|
188
226
|
required: ""
|
|
189
227
|
}, null, 8, ["label", "modelValue"])),
|
|
190
|
-
|
|
228
|
+
C(t(N), {
|
|
191
229
|
type: "password",
|
|
192
230
|
isTitle: !1,
|
|
193
231
|
autocomplete: "new-password",
|
|
194
232
|
"show-password": "",
|
|
195
233
|
prop: "pwd",
|
|
196
|
-
label:
|
|
197
|
-
modelValue:
|
|
198
|
-
"onUpdate:modelValue":
|
|
234
|
+
label: t(d)("新密码"),
|
|
235
|
+
modelValue: t(m).pwd,
|
|
236
|
+
"onUpdate:modelValue": w[1] || (w[1] = (f) => t(m).pwd = f),
|
|
199
237
|
modelModifiers: { trim: !0 },
|
|
200
238
|
maxlength: 20,
|
|
201
239
|
required: ""
|
|
202
240
|
}, null, 8, ["label", "modelValue"]),
|
|
203
|
-
|
|
241
|
+
C(t(N), {
|
|
204
242
|
type: "password",
|
|
205
243
|
isTitle: !1,
|
|
206
244
|
autocomplete: "new-password",
|
|
207
245
|
"show-password": "",
|
|
208
246
|
prop: "confirmPwd",
|
|
209
|
-
label:
|
|
210
|
-
modelValue:
|
|
211
|
-
"onUpdate:modelValue":
|
|
247
|
+
label: t(d)("确认新密码"),
|
|
248
|
+
modelValue: t(m).confirmPwd,
|
|
249
|
+
"onUpdate:modelValue": w[2] || (w[2] = (f) => t(m).confirmPwd = f),
|
|
212
250
|
modelModifiers: { trim: !0 },
|
|
213
251
|
maxlength: 20,
|
|
214
252
|
required: ""
|
|
@@ -223,12 +261,12 @@ const S = M.get("/user/change-pwd", (n) => (n.ignoreErrorMessage = !0, n)), A =
|
|
|
223
261
|
/* STABLE */
|
|
224
262
|
}, 8, ["title", "modelValue", "before-close"]));
|
|
225
263
|
}
|
|
226
|
-
}),
|
|
227
|
-
const
|
|
228
|
-
for (const [
|
|
229
|
-
|
|
230
|
-
return
|
|
231
|
-
},
|
|
264
|
+
}), le = (r, n) => {
|
|
265
|
+
const p = r.__vccOpts || r;
|
|
266
|
+
for (const [a, l] of n)
|
|
267
|
+
p[a] = l;
|
|
268
|
+
return p;
|
|
269
|
+
}, ue = /* @__PURE__ */ le(de, [["__scopeId", "data-v-901c1af6"]]), we = {
|
|
232
270
|
新密码不能为空: { "zh-CN": "新密码不能为空", en: "New password cannot be empty", _appCode: "framework" },
|
|
233
271
|
确认密码不能为空: { "zh-CN": "确认密码不能为空", en: "Confirm password cannot be empty", _appCode: "framework" },
|
|
234
272
|
与新密码不一致: { "zh-CN": "与新密码不一致", en: "Doesn't match the new password", _appCode: "framework" },
|
|
@@ -260,9 +298,9 @@ const S = M.get("/user/change-pwd", (n) => (n.ignoreErrorMessage = !0, n)), A =
|
|
|
260
298
|
_appCode: "framework"
|
|
261
299
|
}
|
|
262
300
|
};
|
|
263
|
-
|
|
264
|
-
const
|
|
301
|
+
$(we);
|
|
302
|
+
const Le = O(ue), Ne = () => y(null);
|
|
265
303
|
export {
|
|
266
|
-
|
|
267
|
-
|
|
304
|
+
Le as DasChangePwd,
|
|
305
|
+
Ne as DasChangePwdRef
|
|
268
306
|
};
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取 EnterpriseRight 服务的 RSA 公钥字符串。
|
|
3
|
+
* 请求失败时返回空字符串,由调用方兼容旧编码方式。
|
|
4
|
+
*/
|
|
5
|
+
export declare const getEnterpriseRightPublicKey: () => Promise<string>;
|
|
6
|
+
/**
|
|
7
|
+
* 获取 OAuth 服务的 RSA 公钥字符串。
|
|
8
|
+
* 请求失败时返回空字符串,由调用方兼容旧编码方式。
|
|
9
|
+
*/
|
|
10
|
+
export declare const getAuthPublicKey: () => Promise<string>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type GetPublicKey = () => Promise<string>;
|
|
2
|
+
export type SensitiveValueEncryptor = (value: string) => Promise<string>;
|
|
3
|
+
/**
|
|
4
|
+
* 根据对应服务的公钥创建敏感值加密函数。
|
|
5
|
+
* 公钥不可用时保留原编码方式,确保兼容尚未启用 RSA 的服务。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createSensitiveValueEncryptor: (getPublicKey: GetPublicKey) => Promise<SensitiveValueEncryptor>;
|
|
8
|
+
export {};
|