@huyooo/ui 2.0.12 → 2.0.13
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/dist/{AuthkitAppSetting-Dgxd5GMR.js → AuthkitAppSetting-BHISSsE3.js} +664 -643
- package/dist/{LegalDocViewer-BWTrNIUE.js → LegalDocViewer-uL1PnRNg.js} +859 -862
- package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-CwB8zI6u.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-DZ2MePNN.js} +1 -1
- package/dist/{WidthContainer-TAMNaEHp.js → WidthContainer-BONpaF0g.js} +1 -1
- package/dist/authkit.js +2 -2
- package/dist/common.js +1 -1
- package/dist/components/Authkit/Auth/AuthkitOauthList.vue.d.ts +2 -7
- package/dist/components/Authkit/Auth/AuthkitSignIn.vue.d.ts +16 -6
- package/dist/main.js +4 -4
- package/dist/style.css +1 -1
- package/dist/user.js +1 -1
- package/package.json +1 -1
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { U as
|
|
4
|
-
import { defineComponent as J, ref as A, computed as $, openBlock as y, createElementBlock as M, createElementVNode as z, createVNode as m, unref as n, withCtx as o, createTextVNode as k, createCommentVNode as
|
|
5
|
-
import { Avatar as Ee, Input as Q, Textarea as
|
|
3
|
+
import { U as Me } from "./userMenuModal-D-nDaYqM.js";
|
|
4
|
+
import { defineComponent as J, ref as A, computed as $, openBlock as y, createElementBlock as M, createElementVNode as z, createVNode as m, unref as n, withCtx as o, createTextVNode as k, createCommentVNode as C, toDisplayString as U, createBlock as I, onUnmounted as Ae, withDirectives as Ke, vShow as Fe, onMounted as de, Fragment as ie, createSlots as He, normalizeClass as Pe, renderList as We, watch as Ie } from "vue";
|
|
5
|
+
import { Avatar as Ee, Input as Q, Textarea as Ge, Button as T, Message as G, Form as le, FormItem as L, Alert as Y, Space as me, Popconfirm as Ye, Link as Re, InputPassword as Je, Result as je, Modal as Qe } from "@arco-design/web-vue";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import { f as
|
|
8
|
-
import { C as
|
|
7
|
+
import { f as Xe, g as x, b as Ze, h as Se } from "./apiClients-Ctcq8NZs.js";
|
|
8
|
+
import { C as et } from "./index-Cn6LcfZO.js";
|
|
9
9
|
/* empty css */
|
|
10
10
|
import { u as ne } from "./useAuthkitUsersProfile-8FzLTfUJ.js";
|
|
11
|
-
import { u as
|
|
11
|
+
import { u as Ve, g as $e } from "./runtime-Dp7MgwhI.js";
|
|
12
12
|
import { _ as X } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
/* empty css */
|
|
14
14
|
/* empty css */
|
|
15
|
-
import { C as
|
|
16
|
-
import { u as
|
|
17
|
-
import { Icon as
|
|
18
|
-
import { i as
|
|
19
|
-
import { u as
|
|
20
|
-
import { u as
|
|
21
|
-
const
|
|
15
|
+
import { C as tt } from "./CustomTable-HDwqEcmB.js";
|
|
16
|
+
import { u as Te } from "./useAuthkitAppsAuthPageInfo-DZ1p-P3Q.js";
|
|
17
|
+
import { Icon as it } from "@iconify/vue";
|
|
18
|
+
import { i as nt, M as at } from "./Menu-uCexrsKP.js";
|
|
19
|
+
import { u as ot } from "./useAuthkitAuth-cHrJMM8E.js";
|
|
20
|
+
import { u as st } from "./useAuthkitCreateAndUpdate-Bbv7vZZn.js";
|
|
21
|
+
const lt = {
|
|
22
22
|
class: "personal-information"
|
|
23
|
-
}, lt = {
|
|
24
|
-
class: "profile-card"
|
|
25
23
|
}, rt = {
|
|
26
|
-
class: "profile-
|
|
24
|
+
class: "profile-card"
|
|
27
25
|
}, ut = {
|
|
26
|
+
class: "profile-field profile-field--nickname"
|
|
27
|
+
}, dt = {
|
|
28
28
|
class: "nickname-field"
|
|
29
|
-
},
|
|
29
|
+
}, ct = ["disabled"], ft = {
|
|
30
30
|
class: "profile-field"
|
|
31
|
-
},
|
|
31
|
+
}, pt = {
|
|
32
32
|
key: 0,
|
|
33
33
|
class: "profile-actions"
|
|
34
|
-
}, pt = {
|
|
35
|
-
class: "profile-card profile-card--meta"
|
|
36
34
|
}, mt = {
|
|
37
|
-
class: "
|
|
35
|
+
class: "profile-card profile-card--meta"
|
|
38
36
|
}, vt = {
|
|
39
|
-
class: "account-
|
|
37
|
+
class: "account-meta"
|
|
40
38
|
}, ht = {
|
|
41
39
|
class: "account-meta__row"
|
|
42
40
|
}, yt = {
|
|
43
41
|
class: "account-meta__row"
|
|
44
42
|
}, gt = {
|
|
45
43
|
class: "account-meta__row"
|
|
46
|
-
}, wt =
|
|
44
|
+
}, wt = {
|
|
45
|
+
class: "account-meta__row"
|
|
46
|
+
}, bt = 1e3, _t = /* @__PURE__ */ J({
|
|
47
47
|
__name: "AuthkitPersonalInformation",
|
|
48
48
|
props: {
|
|
49
49
|
size: {
|
|
@@ -56,11 +56,11 @@ const st = {
|
|
|
56
56
|
emit: i
|
|
57
57
|
}) {
|
|
58
58
|
const a = i, {
|
|
59
|
-
fetchUserProfile:
|
|
59
|
+
fetchUserProfile: s
|
|
60
60
|
} = ne(), {
|
|
61
|
-
config:
|
|
61
|
+
config: l,
|
|
62
62
|
upload: d
|
|
63
|
-
} =
|
|
63
|
+
} = Ve(), r = e, t = A({
|
|
64
64
|
id: void 0,
|
|
65
65
|
nickname: "",
|
|
66
66
|
description: "",
|
|
@@ -68,7 +68,7 @@ const st = {
|
|
|
68
68
|
avatarUrl: "",
|
|
69
69
|
email: "",
|
|
70
70
|
phone: ""
|
|
71
|
-
}),
|
|
71
|
+
}), v = A({
|
|
72
72
|
nickname: "",
|
|
73
73
|
description: ""
|
|
74
74
|
}), g = A({
|
|
@@ -76,9 +76,9 @@ const st = {
|
|
|
76
76
|
createAt: "",
|
|
77
77
|
status: "",
|
|
78
78
|
loginIdentity: "-"
|
|
79
|
-
}), f = A(!1),
|
|
79
|
+
}), f = A(!1), h = A(!1), u = $(() => t.value.nickname !== v.value.nickname || t.value.description !== v.value.description);
|
|
80
80
|
function p() {
|
|
81
|
-
|
|
81
|
+
v.value = {
|
|
82
82
|
nickname: t.value.nickname,
|
|
83
83
|
description: t.value.description
|
|
84
84
|
};
|
|
@@ -88,26 +88,26 @@ const st = {
|
|
|
88
88
|
id: V.id,
|
|
89
89
|
createAt: V.createAt || "-",
|
|
90
90
|
status: V.status || "",
|
|
91
|
-
loginIdentity:
|
|
91
|
+
loginIdentity: Ze(V)
|
|
92
92
|
}, p();
|
|
93
93
|
}
|
|
94
94
|
async function R() {
|
|
95
|
-
|
|
95
|
+
h.value = !0;
|
|
96
96
|
const {
|
|
97
97
|
data: V,
|
|
98
98
|
error: w
|
|
99
99
|
} = await x().auth.users.profile.post({});
|
|
100
|
-
if (
|
|
100
|
+
if (h.value = !1, w || !V)
|
|
101
101
|
return;
|
|
102
102
|
S(V);
|
|
103
103
|
}
|
|
104
104
|
function B() {
|
|
105
|
-
t.value.nickname =
|
|
105
|
+
t.value.nickname = v.value.nickname, t.value.description = v.value.description;
|
|
106
106
|
}
|
|
107
107
|
async function K() {
|
|
108
108
|
if (!t.value.id)
|
|
109
109
|
return;
|
|
110
|
-
|
|
110
|
+
h.value = !0;
|
|
111
111
|
const V = {
|
|
112
112
|
id: t.value.id,
|
|
113
113
|
nickname: t.value.nickname,
|
|
@@ -117,7 +117,7 @@ const st = {
|
|
|
117
117
|
data: w,
|
|
118
118
|
error: q
|
|
119
119
|
} = await x().auth.users.update.baseInfo.post(V);
|
|
120
|
-
|
|
120
|
+
h.value = !1, !q && w && (G.success("更新成功"), t.value.avatarUrl = w.avatarUrl || t.value.avatarUrl, p(), await s(), a("submit"));
|
|
121
121
|
}
|
|
122
122
|
function j() {
|
|
123
123
|
const V = document.createElement("input");
|
|
@@ -133,7 +133,7 @@ const st = {
|
|
|
133
133
|
data: P,
|
|
134
134
|
error: N
|
|
135
135
|
} = await d.upload({
|
|
136
|
-
bucketId:
|
|
136
|
+
bucketId: l.avatarBucketId,
|
|
137
137
|
file: _
|
|
138
138
|
});
|
|
139
139
|
if (N || !P) {
|
|
@@ -146,14 +146,14 @@ const st = {
|
|
|
146
146
|
description: t.value.description,
|
|
147
147
|
avatar: P.key
|
|
148
148
|
});
|
|
149
|
-
f.value = !1, F.error || (G.success("头像已更新"), await R(), await
|
|
149
|
+
f.value = !1, F.error || (G.success("头像已更新"), await R(), await s(), a("submit")), V.remove();
|
|
150
150
|
}), V.click();
|
|
151
151
|
}
|
|
152
|
-
return R(), (V, w) => (y(), M("div",
|
|
152
|
+
return R(), (V, w) => (y(), M("div", lt, [z("section", rt, [w[6] || (w[6] = z("h3", {
|
|
153
153
|
class: "profile-card__title"
|
|
154
|
-
}, "个人资料", -1)), z("div",
|
|
154
|
+
}, "个人资料", -1)), z("div", ut, [w[2] || (w[2] = z("label", {
|
|
155
155
|
class: "profile-field__label"
|
|
156
|
-
}, "昵称", -1)), z("div",
|
|
156
|
+
}, "昵称", -1)), z("div", dt, [z("button", {
|
|
157
157
|
type: "button",
|
|
158
158
|
class: "nickname-field__avatar",
|
|
159
159
|
disabled: f.value,
|
|
@@ -163,48 +163,48 @@ const st = {
|
|
|
163
163
|
"image-url": t.value.avatarUrl,
|
|
164
164
|
size: 28,
|
|
165
165
|
"object-fit": "cover"
|
|
166
|
-
}, null, 8, ["image-url"])], 8,
|
|
166
|
+
}, null, 8, ["image-url"])], 8, ct), m(n(Q), {
|
|
167
167
|
modelValue: t.value.nickname,
|
|
168
168
|
"onUpdate:modelValue": w[0] || (w[0] = (q) => t.value.nickname = q),
|
|
169
169
|
class: "nickname-field__input",
|
|
170
|
-
size:
|
|
170
|
+
size: r.size,
|
|
171
171
|
placeholder: "例如:小明"
|
|
172
|
-
}, null, 8, ["modelValue", "size"])])]), z("div",
|
|
172
|
+
}, null, 8, ["modelValue", "size"])])]), z("div", ft, [w[3] || (w[3] = z("label", {
|
|
173
173
|
class: "profile-field__label"
|
|
174
|
-
}, "个人简介", -1)), m(n(
|
|
174
|
+
}, "个人简介", -1)), m(n(Ge), {
|
|
175
175
|
modelValue: t.value.description,
|
|
176
176
|
"onUpdate:modelValue": w[1] || (w[1] = (q) => t.value.description = q),
|
|
177
|
-
size:
|
|
177
|
+
size: r.size,
|
|
178
178
|
placeholder: "介绍一下你自己",
|
|
179
|
-
"max-length":
|
|
179
|
+
"max-length": bt,
|
|
180
180
|
"show-word-limit": "",
|
|
181
181
|
"auto-size": {
|
|
182
182
|
minRows: 4,
|
|
183
183
|
maxRows: 8
|
|
184
184
|
}
|
|
185
|
-
}, null, 8, ["modelValue", "size"])]),
|
|
186
|
-
size:
|
|
185
|
+
}, null, 8, ["modelValue", "size"])]), u.value ? (y(), M("div", pt, [m(n(T), {
|
|
186
|
+
size: r.size,
|
|
187
187
|
onClick: B
|
|
188
188
|
}, {
|
|
189
189
|
default: o(() => [...w[4] || (w[4] = [k("取消", -1)])]),
|
|
190
190
|
_: 1
|
|
191
191
|
}, 8, ["size"]), m(n(T), {
|
|
192
192
|
type: "primary",
|
|
193
|
-
size:
|
|
194
|
-
loading:
|
|
193
|
+
size: r.size,
|
|
194
|
+
loading: h.value,
|
|
195
195
|
onClick: K
|
|
196
196
|
}, {
|
|
197
197
|
default: o(() => [...w[5] || (w[5] = [k(" 保存修改 ", -1)])]),
|
|
198
198
|
_: 1
|
|
199
|
-
}, 8, ["size", "loading"])])) :
|
|
199
|
+
}, 8, ["size", "loading"])])) : C("", !0)]), z("section", mt, [w[11] || (w[11] = z("h3", {
|
|
200
200
|
class: "profile-card__title"
|
|
201
|
-
}, "账号信息", -1)), z("dl",
|
|
201
|
+
}, "账号信息", -1)), z("dl", vt, [z("div", ht, [w[7] || (w[7] = z("dt", null, "用户 ID", -1)), z("dd", null, [z("span", null, U(g.value.id || "-"), 1), g.value.id ? (y(), I(et, {
|
|
202
202
|
key: 0,
|
|
203
203
|
value: g.value.id,
|
|
204
204
|
message: "用户 ID 已复制"
|
|
205
|
-
}, null, 8, ["value"])) :
|
|
205
|
+
}, null, 8, ["value"])) : C("", !0)])]), z("div", yt, [w[8] || (w[8] = z("dt", null, "注册时间", -1)), z("dd", null, U(g.value.createAt || "-"), 1)]), z("div", gt, [w[9] || (w[9] = z("dt", null, "账号状态", -1)), z("dd", null, U(n(Xe)(g.value.status)), 1)]), z("div", wt, [w[10] || (w[10] = z("dt", null, "登录标识", -1)), z("dd", null, U(g.value.loginIdentity), 1)])])])]));
|
|
206
206
|
}
|
|
207
|
-
}),
|
|
207
|
+
}), kt = /* @__PURE__ */ X(_t, [["__scopeId", "data-v-e03e688b"]]), At = /* @__PURE__ */ J({
|
|
208
208
|
__name: "AuthkitSendVerifyCode",
|
|
209
209
|
props: {
|
|
210
210
|
size: {
|
|
@@ -222,13 +222,13 @@ const st = {
|
|
|
222
222
|
expose: i,
|
|
223
223
|
emit: a
|
|
224
224
|
}) {
|
|
225
|
-
const
|
|
226
|
-
let
|
|
227
|
-
const t = A(0),
|
|
225
|
+
const s = a, l = e, d = A(!1);
|
|
226
|
+
let r;
|
|
227
|
+
const t = A(0), v = $(() => t.value.toString().padStart(2, "0")), g = $(() => t.value > 0);
|
|
228
228
|
function f() {
|
|
229
|
-
|
|
229
|
+
r && (clearInterval(r), r = void 0);
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function h() {
|
|
232
232
|
if (d.value) {
|
|
233
233
|
if (t.value <= 0) {
|
|
234
234
|
f(), d.value = !1;
|
|
@@ -237,11 +237,11 @@ const st = {
|
|
|
237
237
|
t.value--, t.value <= 0 && (f(), d.value = !1);
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
|
|
240
|
+
function u() {
|
|
241
|
+
s("send");
|
|
242
242
|
}
|
|
243
243
|
function p(S) {
|
|
244
|
-
!Number.isFinite(S) || S <= 0 || (t.value = Math.ceil(S), d.value = !0, f(),
|
|
244
|
+
!Number.isFinite(S) || S <= 0 || (t.value = Math.ceil(S), d.value = !0, f(), r = setInterval(h, 1e3));
|
|
245
245
|
}
|
|
246
246
|
return i({
|
|
247
247
|
startCountFn: p
|
|
@@ -250,19 +250,19 @@ const st = {
|
|
|
250
250
|
}), (S, R) => (y(), I(n(T), {
|
|
251
251
|
class: "OAuthItem",
|
|
252
252
|
type: "primary",
|
|
253
|
-
size:
|
|
253
|
+
size: l.size,
|
|
254
254
|
disabled: g.value,
|
|
255
|
-
loading:
|
|
256
|
-
onClick:
|
|
255
|
+
loading: l.loading,
|
|
256
|
+
onClick: u
|
|
257
257
|
}, {
|
|
258
|
-
default: o(() => [R[0] || (R[0] = z("span", null, " 发送验证码", -1)),
|
|
258
|
+
default: o(() => [R[0] || (R[0] = z("span", null, " 发送验证码", -1)), Ke(z("span", {
|
|
259
259
|
class: "verify-code-timer"
|
|
260
|
-
}, U(`(${
|
|
260
|
+
}, U(`(${v.value})`), 513), [[Fe, g.value]])]),
|
|
261
261
|
_: 1
|
|
262
262
|
}, 8, ["size", "disabled", "loading"]));
|
|
263
263
|
}
|
|
264
|
-
}), he = /* @__PURE__ */ X(
|
|
265
|
-
function
|
|
264
|
+
}), he = /* @__PURE__ */ X(At, [["__scopeId", "data-v-63c6fb3a"]]);
|
|
265
|
+
function zt(e) {
|
|
266
266
|
if (!e)
|
|
267
267
|
return null;
|
|
268
268
|
const i = e.match(/请\s*(\d+)\s*秒后再试/);
|
|
@@ -272,19 +272,19 @@ function At(e) {
|
|
|
272
272
|
return Number.isFinite(a) && a > 0 ? a : null;
|
|
273
273
|
}
|
|
274
274
|
function ke(e) {
|
|
275
|
-
var a,
|
|
275
|
+
var a, s;
|
|
276
276
|
const i = (a = e.data) == null ? void 0 : a.cooldownSeconds;
|
|
277
|
-
return typeof i == "number" && i > 0 ? i :
|
|
277
|
+
return typeof i == "number" && i > 0 ? i : zt((s = e.error) == null ? void 0 : s.message);
|
|
278
278
|
}
|
|
279
279
|
function ye(e, i) {
|
|
280
280
|
const a = ke(i);
|
|
281
281
|
a && e && e.startCountFn(a);
|
|
282
282
|
}
|
|
283
|
-
const
|
|
283
|
+
const Pt = {
|
|
284
284
|
class: "sendVerifyCodeItem"
|
|
285
|
-
},
|
|
285
|
+
}, It = {
|
|
286
286
|
class: "handle"
|
|
287
|
-
},
|
|
287
|
+
}, Ct = /* @__PURE__ */ J({
|
|
288
288
|
__name: "AuthkitEmailVerify",
|
|
289
289
|
props: {
|
|
290
290
|
email: {
|
|
@@ -301,25 +301,25 @@ const zt = {
|
|
|
301
301
|
setup(e, {
|
|
302
302
|
emit: i
|
|
303
303
|
}) {
|
|
304
|
-
const a = i,
|
|
304
|
+
const a = i, s = e, l = $(() => Se(s.email)), d = A(), r = A(!1), t = A(!1), v = A(), g = A({
|
|
305
305
|
userToken: void 0,
|
|
306
306
|
emailVerifyId: void 0
|
|
307
307
|
});
|
|
308
308
|
async function f() {
|
|
309
|
-
|
|
310
|
-
const
|
|
311
|
-
email:
|
|
309
|
+
r.value = !0;
|
|
310
|
+
const u = await x().auth.verify.email.retry.post({
|
|
311
|
+
email: s.email,
|
|
312
312
|
purpose: "bindEmail"
|
|
313
313
|
});
|
|
314
|
-
|
|
314
|
+
r.value = !1, u.data && (g.value.emailVerifyId = u.data.emailVerifyId), ye(d.value, u);
|
|
315
315
|
}
|
|
316
|
-
async function
|
|
317
|
-
if (!await
|
|
316
|
+
async function h() {
|
|
317
|
+
if (!await v.value.validate(["userToken"])) {
|
|
318
318
|
t.value = !0;
|
|
319
319
|
const {
|
|
320
320
|
error: p
|
|
321
321
|
} = await x().auth.verify.email.post({
|
|
322
|
-
email:
|
|
322
|
+
email: s.email,
|
|
323
323
|
userToken: g.value.userToken,
|
|
324
324
|
emailVerifyId: g.value.emailVerifyId,
|
|
325
325
|
purpose: "bindEmail"
|
|
@@ -327,12 +327,12 @@ const zt = {
|
|
|
327
327
|
t.value = !1, p || a("next");
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
return (
|
|
330
|
+
return (u, p) => (y(), I(n(le), {
|
|
331
331
|
ref_key: "formRef",
|
|
332
|
-
ref:
|
|
332
|
+
ref: v,
|
|
333
333
|
model: g.value,
|
|
334
334
|
"auto-label-width": "",
|
|
335
|
-
size:
|
|
335
|
+
size: s.size
|
|
336
336
|
}, {
|
|
337
337
|
default: o(() => [m(n(L), {
|
|
338
338
|
field: "email",
|
|
@@ -345,7 +345,7 @@ const zt = {
|
|
|
345
345
|
message: "请输入有效的邮箱"
|
|
346
346
|
}]
|
|
347
347
|
}, {
|
|
348
|
-
default: o(() => [k(U(
|
|
348
|
+
default: o(() => [k(U(l.value), 1)]),
|
|
349
349
|
_: 1
|
|
350
350
|
}), m(n(L), {
|
|
351
351
|
field: "userToken",
|
|
@@ -356,15 +356,15 @@ const zt = {
|
|
|
356
356
|
message: "请输入验证码"
|
|
357
357
|
}]
|
|
358
358
|
}, {
|
|
359
|
-
default: o(() => [z("div",
|
|
359
|
+
default: o(() => [z("div", Pt, [m(n(Q), {
|
|
360
360
|
modelValue: g.value.userToken,
|
|
361
361
|
"onUpdate:modelValue": p[0] || (p[0] = (S) => g.value.userToken = S),
|
|
362
362
|
placeholder: "请输入验证码"
|
|
363
363
|
}, null, 8, ["modelValue"]), m(he, {
|
|
364
364
|
ref_key: "SendVerifyCodeRef",
|
|
365
365
|
ref: d,
|
|
366
|
-
size:
|
|
367
|
-
loading:
|
|
366
|
+
size: s.size,
|
|
367
|
+
loading: r.value,
|
|
368
368
|
style: {
|
|
369
369
|
"margin-left": "10px"
|
|
370
370
|
},
|
|
@@ -376,10 +376,10 @@ const zt = {
|
|
|
376
376
|
label: "",
|
|
377
377
|
rules: []
|
|
378
378
|
}, {
|
|
379
|
-
default: o(() => [z("div",
|
|
379
|
+
default: o(() => [z("div", It, [m(n(T), {
|
|
380
380
|
loading: t.value,
|
|
381
381
|
type: "primary",
|
|
382
|
-
onClick:
|
|
382
|
+
onClick: h
|
|
383
383
|
}, {
|
|
384
384
|
default: o(() => [...p[1] || (p[1] = [k(" 提交 ", -1)])]),
|
|
385
385
|
_: 1
|
|
@@ -389,11 +389,11 @@ const zt = {
|
|
|
389
389
|
_: 1
|
|
390
390
|
}, 8, ["model", "size"]));
|
|
391
391
|
}
|
|
392
|
-
}), ge = /* @__PURE__ */ X(
|
|
392
|
+
}), ge = /* @__PURE__ */ X(Ct, [["__scopeId", "data-v-0939d925"]]), Et = {
|
|
393
393
|
class: "sendVerifyCodeItem"
|
|
394
|
-
},
|
|
394
|
+
}, Rt = {
|
|
395
395
|
class: "handle"
|
|
396
|
-
},
|
|
396
|
+
}, St = /* @__PURE__ */ J({
|
|
397
397
|
__name: "AuthkitPhoneVerify",
|
|
398
398
|
props: {
|
|
399
399
|
phone: {
|
|
@@ -413,39 +413,39 @@ const zt = {
|
|
|
413
413
|
setup(e, {
|
|
414
414
|
emit: i
|
|
415
415
|
}) {
|
|
416
|
-
const a = i,
|
|
416
|
+
const a = i, s = e, l = A(), d = A(!1), r = A(!1), t = A(), v = A({
|
|
417
417
|
code: void 0
|
|
418
418
|
}), g = $(() => {
|
|
419
|
-
const
|
|
420
|
-
return
|
|
419
|
+
const u = s.phone.trim();
|
|
420
|
+
return u.length < 7 ? u : `${u.slice(0, 3)}****${u.slice(-4)}`;
|
|
421
421
|
});
|
|
422
422
|
async function f() {
|
|
423
423
|
d.value = !0;
|
|
424
|
-
const
|
|
425
|
-
phone:
|
|
426
|
-
purpose:
|
|
424
|
+
const u = await x().auth.verify.sms.send.post({
|
|
425
|
+
phone: s.phone,
|
|
426
|
+
purpose: s.purpose
|
|
427
427
|
});
|
|
428
|
-
d.value = !1, ye(
|
|
428
|
+
d.value = !1, ye(l.value, u);
|
|
429
429
|
}
|
|
430
|
-
async function
|
|
430
|
+
async function h() {
|
|
431
431
|
if (!await t.value.validate(["code"])) {
|
|
432
|
-
|
|
432
|
+
r.value = !0;
|
|
433
433
|
const {
|
|
434
434
|
error: p
|
|
435
435
|
} = await x().auth.verify.sms.verify.post({
|
|
436
|
-
phone:
|
|
437
|
-
code:
|
|
438
|
-
purpose:
|
|
436
|
+
phone: s.phone,
|
|
437
|
+
code: v.value.code,
|
|
438
|
+
purpose: s.purpose
|
|
439
439
|
});
|
|
440
|
-
|
|
440
|
+
r.value = !1, p || a("next");
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
-
return (
|
|
443
|
+
return (u, p) => (y(), I(n(le), {
|
|
444
444
|
ref_key: "formRef",
|
|
445
445
|
ref: t,
|
|
446
|
-
model:
|
|
446
|
+
model: v.value,
|
|
447
447
|
"auto-label-width": "",
|
|
448
|
-
size:
|
|
448
|
+
size: s.size
|
|
449
449
|
}, {
|
|
450
450
|
default: o(() => [m(n(L), {
|
|
451
451
|
field: "phone",
|
|
@@ -463,13 +463,13 @@ const zt = {
|
|
|
463
463
|
}]
|
|
464
464
|
}, {
|
|
465
465
|
default: o(() => [z("div", Et, [m(n(Q), {
|
|
466
|
-
modelValue:
|
|
467
|
-
"onUpdate:modelValue": p[0] || (p[0] = (S) =>
|
|
466
|
+
modelValue: v.value.code,
|
|
467
|
+
"onUpdate:modelValue": p[0] || (p[0] = (S) => v.value.code = S),
|
|
468
468
|
placeholder: "请输入验证码"
|
|
469
469
|
}, null, 8, ["modelValue"]), m(he, {
|
|
470
470
|
ref_key: "sendVerifyCodeRef",
|
|
471
|
-
ref:
|
|
472
|
-
size:
|
|
471
|
+
ref: l,
|
|
472
|
+
size: s.size,
|
|
473
473
|
loading: d.value,
|
|
474
474
|
style: {
|
|
475
475
|
"margin-left": "10px"
|
|
@@ -482,10 +482,10 @@ const zt = {
|
|
|
482
482
|
label: "",
|
|
483
483
|
rules: []
|
|
484
484
|
}, {
|
|
485
|
-
default: o(() => [z("div",
|
|
486
|
-
loading:
|
|
485
|
+
default: o(() => [z("div", Rt, [m(n(T), {
|
|
486
|
+
loading: r.value,
|
|
487
487
|
type: "primary",
|
|
488
|
-
onClick:
|
|
488
|
+
onClick: h
|
|
489
489
|
}, {
|
|
490
490
|
default: o(() => [...p[1] || (p[1] = [k("提交", -1)])]),
|
|
491
491
|
_: 1
|
|
@@ -495,9 +495,9 @@ const zt = {
|
|
|
495
495
|
_: 1
|
|
496
496
|
}, 8, ["model", "size"]));
|
|
497
497
|
}
|
|
498
|
-
}), we = /* @__PURE__ */ X(
|
|
498
|
+
}), we = /* @__PURE__ */ X(St, [["__scopeId", "data-v-d26a59d3"]]), Vt = {
|
|
499
499
|
class: "handle"
|
|
500
|
-
},
|
|
500
|
+
}, $t = /* @__PURE__ */ J({
|
|
501
501
|
__name: "AuthkitPasswordUpdate",
|
|
502
502
|
props: {
|
|
503
503
|
size: {
|
|
@@ -513,7 +513,7 @@ const zt = {
|
|
|
513
513
|
setup(e, {
|
|
514
514
|
emit: i
|
|
515
515
|
}) {
|
|
516
|
-
const a = i,
|
|
516
|
+
const a = i, s = A(!1), l = A(), d = e, r = A({
|
|
517
517
|
oldPassword: "",
|
|
518
518
|
password: "",
|
|
519
519
|
confirmPassword: ""
|
|
@@ -525,27 +525,27 @@ const zt = {
|
|
|
525
525
|
message: "确认密码不能少于10字符"
|
|
526
526
|
}, {
|
|
527
527
|
validator: (g, f) => {
|
|
528
|
-
g !==
|
|
528
|
+
g !== r.value.password ? f("两次密码输入不一致,请重新输入") : f();
|
|
529
529
|
}
|
|
530
530
|
}];
|
|
531
|
-
async function
|
|
532
|
-
if (!await
|
|
533
|
-
|
|
531
|
+
async function v() {
|
|
532
|
+
if (!await l.value.validate()) {
|
|
533
|
+
s.value = !0;
|
|
534
534
|
const f = d.requireOldPassword ? {
|
|
535
|
-
password:
|
|
536
|
-
oldPassword:
|
|
535
|
+
password: r.value.password,
|
|
536
|
+
oldPassword: r.value.oldPassword
|
|
537
537
|
} : {
|
|
538
|
-
password:
|
|
538
|
+
password: r.value.password
|
|
539
539
|
}, {
|
|
540
|
-
error:
|
|
540
|
+
error: h
|
|
541
541
|
} = await x().auth.users.update.password.post(f);
|
|
542
|
-
|
|
542
|
+
s.value = !1, h || a("submit", f);
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
return (g, f) => (y(), I(n(le), {
|
|
546
546
|
ref_key: "formRef",
|
|
547
|
-
ref:
|
|
548
|
-
model:
|
|
547
|
+
ref: l,
|
|
548
|
+
model: r.value,
|
|
549
549
|
"auto-label-width": "",
|
|
550
550
|
size: d.size
|
|
551
551
|
}, {
|
|
@@ -560,13 +560,13 @@ const zt = {
|
|
|
560
560
|
}]
|
|
561
561
|
}, {
|
|
562
562
|
default: o(() => [m(n(Q), {
|
|
563
|
-
modelValue:
|
|
564
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
563
|
+
modelValue: r.value.oldPassword,
|
|
564
|
+
"onUpdate:modelValue": f[0] || (f[0] = (h) => r.value.oldPassword = h),
|
|
565
565
|
placeholder: "请输入当前密码",
|
|
566
566
|
type: "password"
|
|
567
567
|
}, null, 8, ["modelValue"])]),
|
|
568
568
|
_: 1
|
|
569
|
-
})) :
|
|
569
|
+
})) : C("", !0), m(n(L), {
|
|
570
570
|
field: "password",
|
|
571
571
|
label: d.requireOldPassword ? "新密码" : "登录密码",
|
|
572
572
|
"hide-label": "",
|
|
@@ -579,8 +579,8 @@ const zt = {
|
|
|
579
579
|
}]
|
|
580
580
|
}, {
|
|
581
581
|
default: o(() => [m(n(Q), {
|
|
582
|
-
modelValue:
|
|
583
|
-
"onUpdate:modelValue": f[1] || (f[1] = (
|
|
582
|
+
modelValue: r.value.password,
|
|
583
|
+
"onUpdate:modelValue": f[1] || (f[1] = (h) => r.value.password = h),
|
|
584
584
|
placeholder: d.requireOldPassword ? "请输入新密码" : "请输入登录密码",
|
|
585
585
|
type: "password"
|
|
586
586
|
}, null, 8, ["modelValue", "placeholder"])]),
|
|
@@ -592,8 +592,8 @@ const zt = {
|
|
|
592
592
|
rules: t
|
|
593
593
|
}, {
|
|
594
594
|
default: o(() => [m(n(Q), {
|
|
595
|
-
modelValue:
|
|
596
|
-
"onUpdate:modelValue": f[2] || (f[2] = (
|
|
595
|
+
modelValue: r.value.confirmPassword,
|
|
596
|
+
"onUpdate:modelValue": f[2] || (f[2] = (h) => r.value.confirmPassword = h),
|
|
597
597
|
placeholder: "请输入确认密码",
|
|
598
598
|
type: "password"
|
|
599
599
|
}, null, 8, ["modelValue"])]),
|
|
@@ -603,10 +603,10 @@ const zt = {
|
|
|
603
603
|
label: "",
|
|
604
604
|
rules: []
|
|
605
605
|
}, {
|
|
606
|
-
default: o(() => [z("div",
|
|
606
|
+
default: o(() => [z("div", Vt, [m(n(T), {
|
|
607
607
|
type: "primary",
|
|
608
|
-
loading:
|
|
609
|
-
onClick:
|
|
608
|
+
loading: s.value,
|
|
609
|
+
onClick: v
|
|
610
610
|
}, {
|
|
611
611
|
default: o(() => [...f[3] || (f[3] = [k("提交", -1)])]),
|
|
612
612
|
_: 1
|
|
@@ -616,7 +616,7 @@ const zt = {
|
|
|
616
616
|
_: 1
|
|
617
617
|
}, 8, ["model", "size"]));
|
|
618
618
|
}
|
|
619
|
-
}),
|
|
619
|
+
}), Tt = /* @__PURE__ */ X($t, [["__scopeId", "data-v-627d759a"]]), Ut = /* @__PURE__ */ J({
|
|
620
620
|
__name: "AuthkitSetPassword",
|
|
621
621
|
props: {
|
|
622
622
|
size: {
|
|
@@ -628,37 +628,37 @@ const zt = {
|
|
|
628
628
|
const {
|
|
629
629
|
userProfile: i,
|
|
630
630
|
fetchUserProfile: a,
|
|
631
|
-
isLoggedIn:
|
|
632
|
-
} = ne(),
|
|
633
|
-
function
|
|
634
|
-
|
|
631
|
+
isLoggedIn: s
|
|
632
|
+
} = ne(), l = A("hidden"), d = e;
|
|
633
|
+
function r(g) {
|
|
634
|
+
l.value = g;
|
|
635
635
|
}
|
|
636
636
|
function t(g) {
|
|
637
637
|
var f;
|
|
638
|
-
G.success((f = i.value) != null && f.hasPassword ? "密码修改成功" : "密码设置成功"),
|
|
638
|
+
G.success((f = i.value) != null && f.hasPassword ? "密码修改成功" : "密码设置成功"), l.value = "hidden", a();
|
|
639
639
|
}
|
|
640
|
-
function
|
|
641
|
-
|
|
640
|
+
function v() {
|
|
641
|
+
l.value = "update";
|
|
642
642
|
}
|
|
643
643
|
return de(() => {
|
|
644
|
-
|
|
644
|
+
s.value && !i.value && a();
|
|
645
645
|
}), (g, f) => {
|
|
646
|
-
var
|
|
647
|
-
return y(), M(ie, null, [!((
|
|
646
|
+
var h, u, p, S, R, B, K, j, V;
|
|
647
|
+
return y(), M(ie, null, [!((h = n(i)) != null && h.email) && !((u = n(i)) != null && u.phone) ? (y(), I(n(Y), {
|
|
648
648
|
key: 0,
|
|
649
649
|
type: "info",
|
|
650
650
|
title: "先绑定账号"
|
|
651
651
|
}, {
|
|
652
652
|
default: o(() => [...f[1] || (f[1] = [k(" 请先绑定邮箱或手机号,再设置登录密码。 ", -1)])]),
|
|
653
653
|
_: 1
|
|
654
|
-
})) :
|
|
654
|
+
})) : C("", !0), ((p = n(i)) != null && p.email || (S = n(i)) != null && S.phone) && l.value === "hidden" ? (y(), I(n(Y), {
|
|
655
655
|
key: 1,
|
|
656
656
|
title: (R = n(i)) != null && R.hasPassword ? "更改密码" : "设置登录密码"
|
|
657
657
|
}, {
|
|
658
658
|
action: o(() => [m(n(T), {
|
|
659
659
|
size: d.size,
|
|
660
660
|
type: "primary",
|
|
661
|
-
onClick: f[0] || (f[0] = (w) =>
|
|
661
|
+
onClick: f[0] || (f[0] = (w) => r("verify"))
|
|
662
662
|
}, {
|
|
663
663
|
default: o(() => {
|
|
664
664
|
var w;
|
|
@@ -671,22 +671,22 @@ const zt = {
|
|
|
671
671
|
return [k(U((w = n(i)) != null && w.hasPassword ? "为了账户安全,修改密码前会先验证身份。" : "设置登录密码前会先验证身份。") + " ", 1)];
|
|
672
672
|
}),
|
|
673
673
|
_: 1
|
|
674
|
-
}, 8, ["title"])) :
|
|
674
|
+
}, 8, ["title"])) : C("", !0), l.value === "update" ? (y(), I(Tt, {
|
|
675
675
|
key: 2,
|
|
676
676
|
size: d.size,
|
|
677
677
|
"require-old-password": !!((B = n(i)) != null && B.hasPassword),
|
|
678
678
|
onSubmit: t
|
|
679
|
-
}, null, 8, ["size", "require-old-password"])) :
|
|
679
|
+
}, null, 8, ["size", "require-old-password"])) : C("", !0), l.value === "verify" && ((K = n(i)) != null && K.email) ? (y(), I(ge, {
|
|
680
680
|
key: 3,
|
|
681
681
|
size: d.size,
|
|
682
682
|
email: n(i).email,
|
|
683
|
-
onNext:
|
|
684
|
-
}, null, 8, ["size", "email"])) :
|
|
683
|
+
onNext: v
|
|
684
|
+
}, null, 8, ["size", "email"])) : C("", !0), l.value === "verify" && !((j = n(i)) != null && j.email) && ((V = n(i)) != null && V.phone) ? (y(), I(we, {
|
|
685
685
|
key: 4,
|
|
686
686
|
size: d.size,
|
|
687
687
|
phone: n(i).phone,
|
|
688
|
-
onNext:
|
|
689
|
-
}, null, 8, ["size", "phone"])) :
|
|
688
|
+
onNext: v
|
|
689
|
+
}, null, 8, ["size", "phone"])) : C("", !0)], 64);
|
|
690
690
|
};
|
|
691
691
|
}
|
|
692
692
|
}), fe = {
|
|
@@ -698,20 +698,20 @@ const zt = {
|
|
|
698
698
|
function ee(e) {
|
|
699
699
|
const i = new Uint8Array(e);
|
|
700
700
|
let a = "";
|
|
701
|
-
for (const
|
|
702
|
-
a += String.fromCharCode(
|
|
701
|
+
for (const l of i)
|
|
702
|
+
a += String.fromCharCode(l);
|
|
703
703
|
return btoa(a).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
704
704
|
}
|
|
705
705
|
function ve(e) {
|
|
706
|
-
const i = e.replace(/-/g, "+").replace(/_/g, "/"), a = (4 - i.length % 4) % 4,
|
|
707
|
-
for (let t = 0; t <
|
|
708
|
-
|
|
706
|
+
const i = e.replace(/-/g, "+").replace(/_/g, "/"), a = (4 - i.length % 4) % 4, s = i.padEnd(i.length + a, "="), l = atob(s), d = new ArrayBuffer(l.length), r = new Uint8Array(d);
|
|
707
|
+
for (let t = 0; t < l.length; t++)
|
|
708
|
+
r[t] = l.charCodeAt(t);
|
|
709
709
|
return d;
|
|
710
710
|
}
|
|
711
711
|
function be() {
|
|
712
712
|
return (window == null ? void 0 : window.PublicKeyCredential) !== void 0 && typeof window.PublicKeyCredential == "function";
|
|
713
713
|
}
|
|
714
|
-
function
|
|
714
|
+
function Ue(e) {
|
|
715
715
|
const {
|
|
716
716
|
id: i
|
|
717
717
|
} = e;
|
|
@@ -721,26 +721,26 @@ function $e(e) {
|
|
|
721
721
|
transports: e.transports
|
|
722
722
|
};
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function xe(e) {
|
|
725
725
|
return e === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e);
|
|
726
726
|
}
|
|
727
727
|
class W extends Error {
|
|
728
728
|
constructor({
|
|
729
729
|
message: i,
|
|
730
730
|
code: a,
|
|
731
|
-
cause:
|
|
732
|
-
name:
|
|
731
|
+
cause: s,
|
|
732
|
+
name: l
|
|
733
733
|
}) {
|
|
734
734
|
super(i, {
|
|
735
|
-
cause:
|
|
736
|
-
}), this.name =
|
|
735
|
+
cause: s
|
|
736
|
+
}), this.name = l ?? s.name, this.code = a;
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
|
-
function
|
|
739
|
+
function xt({
|
|
740
740
|
error: e,
|
|
741
741
|
options: i
|
|
742
742
|
}) {
|
|
743
|
-
var
|
|
743
|
+
var s, l, d;
|
|
744
744
|
const {
|
|
745
745
|
publicKey: a
|
|
746
746
|
} = i;
|
|
@@ -754,13 +754,13 @@ function Ut({
|
|
|
754
754
|
cause: e
|
|
755
755
|
});
|
|
756
756
|
} else if (e.name === "ConstraintError") {
|
|
757
|
-
if (((
|
|
757
|
+
if (((s = a.authenticatorSelection) == null ? void 0 : s.requireResidentKey) === !0)
|
|
758
758
|
return new W({
|
|
759
759
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
760
760
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
761
761
|
cause: e
|
|
762
762
|
});
|
|
763
|
-
if (i.mediation === "conditional" && ((
|
|
763
|
+
if (i.mediation === "conditional" && ((l = a.authenticatorSelection) == null ? void 0 : l.userVerification) === "required")
|
|
764
764
|
return new W({
|
|
765
765
|
message: "User verification was required during automatic registration but it could not be performed",
|
|
766
766
|
code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
|
|
@@ -796,9 +796,9 @@ function Ut({
|
|
|
796
796
|
cause: e
|
|
797
797
|
});
|
|
798
798
|
if (e.name === "SecurityError") {
|
|
799
|
-
const
|
|
800
|
-
if (
|
|
801
|
-
if (a.rp.id !==
|
|
799
|
+
const r = window.location.hostname;
|
|
800
|
+
if (xe(r)) {
|
|
801
|
+
if (a.rp.id !== r)
|
|
802
802
|
return new W({
|
|
803
803
|
message: `The RP ID "${a.rp.id}" is invalid for this domain`,
|
|
804
804
|
code: "ERROR_INVALID_RP_ID",
|
|
@@ -825,7 +825,7 @@ function Ut({
|
|
|
825
825
|
}
|
|
826
826
|
return e;
|
|
827
827
|
}
|
|
828
|
-
class
|
|
828
|
+
class Ot {
|
|
829
829
|
createNewAbortSignal() {
|
|
830
830
|
if (this.controller) {
|
|
831
831
|
const a = new Error("Cancelling existing WebAuthn API call for new one");
|
|
@@ -841,12 +841,12 @@ class xt {
|
|
|
841
841
|
}
|
|
842
842
|
}
|
|
843
843
|
}
|
|
844
|
-
const
|
|
845
|
-
function
|
|
846
|
-
if (e && !(
|
|
844
|
+
const Oe = new Ot(), Nt = ["cross-platform", "platform"];
|
|
845
|
+
function Ne(e) {
|
|
846
|
+
if (e && !(Nt.indexOf(e) < 0))
|
|
847
847
|
return e;
|
|
848
848
|
}
|
|
849
|
-
async function
|
|
849
|
+
async function Dt(e) {
|
|
850
850
|
var S;
|
|
851
851
|
const {
|
|
852
852
|
optionsJSON: i,
|
|
@@ -854,84 +854,84 @@ async function Nt(e) {
|
|
|
854
854
|
} = e;
|
|
855
855
|
if (!be())
|
|
856
856
|
throw new Error("WebAuthn is not supported in this browser");
|
|
857
|
-
const
|
|
857
|
+
const s = {
|
|
858
858
|
...i,
|
|
859
859
|
challenge: ve(i.challenge),
|
|
860
860
|
user: {
|
|
861
861
|
...i.user,
|
|
862
862
|
id: ve(i.user.id)
|
|
863
863
|
},
|
|
864
|
-
excludeCredentials: (S = i.excludeCredentials) == null ? void 0 : S.map(
|
|
865
|
-
},
|
|
866
|
-
a && (
|
|
864
|
+
excludeCredentials: (S = i.excludeCredentials) == null ? void 0 : S.map(Ue)
|
|
865
|
+
}, l = {};
|
|
866
|
+
a && (l.mediation = "conditional"), l.publicKey = s, l.signal = Oe.createNewAbortSignal();
|
|
867
867
|
let d;
|
|
868
868
|
try {
|
|
869
|
-
d = await navigator.credentials.create(
|
|
869
|
+
d = await navigator.credentials.create(l);
|
|
870
870
|
} catch (R) {
|
|
871
|
-
throw
|
|
871
|
+
throw xt({
|
|
872
872
|
error: R,
|
|
873
|
-
options:
|
|
873
|
+
options: l
|
|
874
874
|
});
|
|
875
875
|
}
|
|
876
876
|
if (!d)
|
|
877
877
|
throw new Error("Registration was not completed");
|
|
878
878
|
const {
|
|
879
|
-
id:
|
|
879
|
+
id: r,
|
|
880
880
|
rawId: t,
|
|
881
|
-
response:
|
|
881
|
+
response: v,
|
|
882
882
|
type: g
|
|
883
883
|
} = d;
|
|
884
884
|
let f;
|
|
885
|
-
typeof
|
|
886
|
-
let
|
|
887
|
-
if (typeof
|
|
885
|
+
typeof v.getTransports == "function" && (f = v.getTransports());
|
|
886
|
+
let h;
|
|
887
|
+
if (typeof v.getPublicKeyAlgorithm == "function")
|
|
888
888
|
try {
|
|
889
|
-
|
|
889
|
+
h = v.getPublicKeyAlgorithm();
|
|
890
890
|
} catch (R) {
|
|
891
891
|
_e("getPublicKeyAlgorithm()", R);
|
|
892
892
|
}
|
|
893
|
-
let
|
|
894
|
-
if (typeof
|
|
893
|
+
let u;
|
|
894
|
+
if (typeof v.getPublicKey == "function")
|
|
895
895
|
try {
|
|
896
|
-
const R =
|
|
897
|
-
R !== null && (
|
|
896
|
+
const R = v.getPublicKey();
|
|
897
|
+
R !== null && (u = ee(R));
|
|
898
898
|
} catch (R) {
|
|
899
899
|
_e("getPublicKey()", R);
|
|
900
900
|
}
|
|
901
901
|
let p;
|
|
902
|
-
if (typeof
|
|
902
|
+
if (typeof v.getAuthenticatorData == "function")
|
|
903
903
|
try {
|
|
904
|
-
p = ee(
|
|
904
|
+
p = ee(v.getAuthenticatorData());
|
|
905
905
|
} catch (R) {
|
|
906
906
|
_e("getAuthenticatorData()", R);
|
|
907
907
|
}
|
|
908
908
|
return {
|
|
909
|
-
id:
|
|
909
|
+
id: r,
|
|
910
910
|
rawId: ee(t),
|
|
911
911
|
response: {
|
|
912
|
-
attestationObject: ee(
|
|
913
|
-
clientDataJSON: ee(
|
|
912
|
+
attestationObject: ee(v.attestationObject),
|
|
913
|
+
clientDataJSON: ee(v.clientDataJSON),
|
|
914
914
|
transports: f,
|
|
915
|
-
publicKeyAlgorithm:
|
|
916
|
-
publicKey:
|
|
915
|
+
publicKeyAlgorithm: h,
|
|
916
|
+
publicKey: u,
|
|
917
917
|
authenticatorData: p
|
|
918
918
|
},
|
|
919
919
|
type: g,
|
|
920
920
|
clientExtensionResults: d.getClientExtensionResults(),
|
|
921
|
-
authenticatorAttachment:
|
|
921
|
+
authenticatorAttachment: Ne(d.authenticatorAttachment)
|
|
922
922
|
};
|
|
923
923
|
}
|
|
924
924
|
function _e(e, i) {
|
|
925
925
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
|
|
926
926
|
`, i);
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function De() {
|
|
929
929
|
if (!be())
|
|
930
930
|
return new Promise((i) => i(!1));
|
|
931
931
|
const e = window.PublicKeyCredential;
|
|
932
932
|
return e.isConditionalMediationAvailable === void 0 ? new Promise((i) => i(!1)) : e.isConditionalMediationAvailable();
|
|
933
933
|
}
|
|
934
|
-
function
|
|
934
|
+
function Bt({
|
|
935
935
|
error: e,
|
|
936
936
|
options: i
|
|
937
937
|
}) {
|
|
@@ -955,9 +955,9 @@ function Dt({
|
|
|
955
955
|
cause: e
|
|
956
956
|
});
|
|
957
957
|
if (e.name === "SecurityError") {
|
|
958
|
-
const
|
|
959
|
-
if (
|
|
960
|
-
if (a.rpId !==
|
|
958
|
+
const s = window.location.hostname;
|
|
959
|
+
if (xe(s)) {
|
|
960
|
+
if (a.rpId !== s)
|
|
961
961
|
return new W({
|
|
962
962
|
message: `The RP ID "${a.rpId}" is invalid for this domain`,
|
|
963
963
|
code: "ERROR_INVALID_RP_ID",
|
|
@@ -977,160 +977,181 @@ function Dt({
|
|
|
977
977
|
}
|
|
978
978
|
return e;
|
|
979
979
|
}
|
|
980
|
-
async function
|
|
980
|
+
async function qt(e) {
|
|
981
981
|
var p, S;
|
|
982
982
|
const {
|
|
983
983
|
optionsJSON: i,
|
|
984
984
|
useBrowserAutofill: a = !1,
|
|
985
|
-
verifyBrowserAutofillInput:
|
|
985
|
+
verifyBrowserAutofillInput: s = !0
|
|
986
986
|
} = e;
|
|
987
987
|
if (!be())
|
|
988
988
|
throw new Error("WebAuthn is not supported in this browser");
|
|
989
|
-
let
|
|
990
|
-
((p = i.allowCredentials) == null ? void 0 : p.length) !== 0 && (
|
|
989
|
+
let l;
|
|
990
|
+
((p = i.allowCredentials) == null ? void 0 : p.length) !== 0 && (l = (S = i.allowCredentials) == null ? void 0 : S.map(Ue));
|
|
991
991
|
const d = {
|
|
992
992
|
...i,
|
|
993
993
|
challenge: ve(i.challenge),
|
|
994
|
-
allowCredentials:
|
|
995
|
-
},
|
|
994
|
+
allowCredentials: l
|
|
995
|
+
}, r = {};
|
|
996
996
|
if (a) {
|
|
997
|
-
if (!await
|
|
997
|
+
if (!await De())
|
|
998
998
|
throw Error("Browser does not support WebAuthn autofill");
|
|
999
|
-
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 &&
|
|
999
|
+
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && s)
|
|
1000
1000
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
1001
|
-
|
|
1001
|
+
r.mediation = "conditional", d.allowCredentials = [];
|
|
1002
1002
|
}
|
|
1003
|
-
|
|
1003
|
+
r.publicKey = d, r.signal = Oe.createNewAbortSignal();
|
|
1004
1004
|
let t;
|
|
1005
1005
|
try {
|
|
1006
|
-
t = await navigator.credentials.get(
|
|
1006
|
+
t = await navigator.credentials.get(r);
|
|
1007
1007
|
} catch (R) {
|
|
1008
|
-
throw
|
|
1008
|
+
throw Bt({
|
|
1009
1009
|
error: R,
|
|
1010
|
-
options:
|
|
1010
|
+
options: r
|
|
1011
1011
|
});
|
|
1012
1012
|
}
|
|
1013
1013
|
if (!t)
|
|
1014
1014
|
throw new Error("Authentication was not completed");
|
|
1015
1015
|
const {
|
|
1016
|
-
id:
|
|
1016
|
+
id: v,
|
|
1017
1017
|
rawId: g,
|
|
1018
1018
|
response: f,
|
|
1019
|
-
type:
|
|
1019
|
+
type: h
|
|
1020
1020
|
} = t;
|
|
1021
|
-
let
|
|
1022
|
-
return f.userHandle && (
|
|
1023
|
-
id:
|
|
1021
|
+
let u;
|
|
1022
|
+
return f.userHandle && (u = ee(f.userHandle)), {
|
|
1023
|
+
id: v,
|
|
1024
1024
|
rawId: ee(g),
|
|
1025
1025
|
response: {
|
|
1026
1026
|
authenticatorData: ee(f.authenticatorData),
|
|
1027
1027
|
clientDataJSON: ee(f.clientDataJSON),
|
|
1028
1028
|
signature: ee(f.signature),
|
|
1029
|
-
userHandle:
|
|
1029
|
+
userHandle: u
|
|
1030
1030
|
},
|
|
1031
|
-
type:
|
|
1031
|
+
type: h,
|
|
1032
1032
|
clientExtensionResults: t.getClientExtensionResults(),
|
|
1033
|
-
authenticatorAttachment:
|
|
1033
|
+
authenticatorAttachment: Ne(t.authenticatorAttachment)
|
|
1034
1034
|
};
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1036
|
+
function Lt() {
|
|
1037
1037
|
return se() === null;
|
|
1038
1038
|
}
|
|
1039
1039
|
function se() {
|
|
1040
1040
|
return typeof window > "u" ? "非浏览器环境,无法使用 Passkey" : window.isSecureContext ? be() ? null : "当前浏览器不支持 Passkey,请使用 Chrome / Safari / Edge" : "Passkey 需要在安全环境下使用(HTTPS,或 localhost)";
|
|
1041
1041
|
}
|
|
1042
|
-
function
|
|
1042
|
+
function Mt(e) {
|
|
1043
1043
|
return e instanceof Error ? e.name === "NotAllowedError" ? "已取消操作" : e.message.includes("WebAuthn is not supported") ? se() || "当前环境不支持 Passkey" : e.name === "NotSupportedError" ? "当前设备无可用认证器" : e.message || "Passkey 操作失败" : "Passkey 操作失败";
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1045
|
+
function Kt() {
|
|
1046
1046
|
const e = navigator.userAgent;
|
|
1047
1047
|
return e.includes("Chrome") ? "Chrome" : e.includes("Safari") ? "Safari" : e.includes("Firefox") ? "Firefox" : e.includes("Edge") ? "Edge" : "Browser";
|
|
1048
1048
|
}
|
|
1049
|
-
function Kt() {
|
|
1050
|
-
return `${Mt()} - ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`;
|
|
1051
|
-
}
|
|
1052
1049
|
function Ft() {
|
|
1053
|
-
|
|
1054
|
-
|
|
1050
|
+
return `${Kt()} - ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`;
|
|
1051
|
+
}
|
|
1052
|
+
async function Ce(e, i) {
|
|
1053
|
+
const {
|
|
1054
|
+
config: a
|
|
1055
|
+
} = $e();
|
|
1056
|
+
try {
|
|
1057
|
+
const s = await fetch(`${a.authPrefixUrl}/passkey/auth/${e}`, {
|
|
1058
|
+
method: "POST",
|
|
1059
|
+
headers: {
|
|
1060
|
+
"Content-Type": "application/json",
|
|
1061
|
+
"app-id": a.appId
|
|
1062
|
+
},
|
|
1063
|
+
body: JSON.stringify(i ?? {})
|
|
1064
|
+
});
|
|
1065
|
+
return s.ok ? await s.json() : null;
|
|
1066
|
+
} catch {
|
|
1067
|
+
return null;
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
function Ht() {
|
|
1071
|
+
const e = A(!1), i = Lt();
|
|
1072
|
+
async function a(d, r) {
|
|
1055
1073
|
const t = se();
|
|
1056
1074
|
if (t)
|
|
1057
1075
|
throw new Error(t);
|
|
1058
|
-
const
|
|
1059
|
-
if (
|
|
1076
|
+
const v = (r == null ? void 0 : r.useBrowserAutofill) === !0;
|
|
1077
|
+
if (v && !await De())
|
|
1060
1078
|
return null;
|
|
1061
|
-
|
|
1079
|
+
v || (e.value = !0);
|
|
1062
1080
|
try {
|
|
1063
|
-
const {
|
|
1064
|
-
data: g,
|
|
1065
|
-
error: f
|
|
1066
|
-
} = await x().auth.passkey.auth.options.post({
|
|
1081
|
+
const g = v ? await Ce("options", {
|
|
1067
1082
|
email: (d == null ? void 0 : d.trim()) || void 0
|
|
1068
|
-
})
|
|
1069
|
-
|
|
1083
|
+
}) : (await x().auth.passkey.auth.options.post({
|
|
1084
|
+
email: (d == null ? void 0 : d.trim()) || void 0
|
|
1085
|
+
})).data;
|
|
1086
|
+
if (!g)
|
|
1070
1087
|
return null;
|
|
1071
|
-
const
|
|
1088
|
+
const f = await qt({
|
|
1072
1089
|
optionsJSON: g,
|
|
1073
|
-
useBrowserAutofill:
|
|
1090
|
+
useBrowserAutofill: v
|
|
1074
1091
|
});
|
|
1075
|
-
if (
|
|
1092
|
+
if (r != null && r.beforeVerify && !r.beforeVerify())
|
|
1076
1093
|
return null;
|
|
1094
|
+
if (v)
|
|
1095
|
+
return await Ce("verify", {
|
|
1096
|
+
response: f
|
|
1097
|
+
});
|
|
1077
1098
|
const {
|
|
1078
|
-
data:
|
|
1079
|
-
error:
|
|
1099
|
+
data: h,
|
|
1100
|
+
error: u
|
|
1080
1101
|
} = await x().auth.passkey.auth.verify.post({
|
|
1081
|
-
response:
|
|
1102
|
+
response: f
|
|
1082
1103
|
});
|
|
1083
|
-
return
|
|
1104
|
+
return u || !h ? null : h;
|
|
1084
1105
|
} finally {
|
|
1085
|
-
|
|
1106
|
+
v || (e.value = !1);
|
|
1086
1107
|
}
|
|
1087
1108
|
}
|
|
1088
|
-
async function
|
|
1089
|
-
const
|
|
1090
|
-
if (
|
|
1091
|
-
throw new Error(
|
|
1109
|
+
async function s(d) {
|
|
1110
|
+
const r = se();
|
|
1111
|
+
if (r)
|
|
1112
|
+
throw new Error(r);
|
|
1092
1113
|
e.value = !0;
|
|
1093
1114
|
try {
|
|
1094
1115
|
const {
|
|
1095
1116
|
data: t,
|
|
1096
|
-
error:
|
|
1117
|
+
error: v
|
|
1097
1118
|
} = await x().auth.passkey.register.options.post();
|
|
1098
|
-
if (
|
|
1119
|
+
if (v || !t)
|
|
1099
1120
|
return !1;
|
|
1100
|
-
const g = await
|
|
1121
|
+
const g = await Dt({
|
|
1101
1122
|
optionsJSON: t
|
|
1102
1123
|
}), {
|
|
1103
1124
|
error: f
|
|
1104
1125
|
} = await x().auth.passkey.register.verify.post({
|
|
1105
1126
|
response: g,
|
|
1106
|
-
name: (d == null ? void 0 : d.trim()) ||
|
|
1127
|
+
name: (d == null ? void 0 : d.trim()) || Ft()
|
|
1107
1128
|
});
|
|
1108
1129
|
return !f;
|
|
1109
1130
|
} finally {
|
|
1110
1131
|
e.value = !1;
|
|
1111
1132
|
}
|
|
1112
1133
|
}
|
|
1113
|
-
function
|
|
1114
|
-
return
|
|
1134
|
+
function l(d) {
|
|
1135
|
+
return Mt(d);
|
|
1115
1136
|
}
|
|
1116
1137
|
return {
|
|
1117
1138
|
loading: e,
|
|
1118
1139
|
supported: i,
|
|
1119
1140
|
loginWithPasskey: a,
|
|
1120
|
-
registerPasskey:
|
|
1121
|
-
formatError:
|
|
1141
|
+
registerPasskey: s,
|
|
1142
|
+
formatError: l,
|
|
1122
1143
|
getPasskeyEnvironmentIssue: se
|
|
1123
1144
|
};
|
|
1124
1145
|
}
|
|
1125
|
-
const
|
|
1146
|
+
const Wt = {
|
|
1126
1147
|
class: "passkey-binding"
|
|
1127
|
-
},
|
|
1148
|
+
}, Gt = {
|
|
1128
1149
|
key: 0,
|
|
1129
1150
|
class: "passkey-binding__issue"
|
|
1130
|
-
},
|
|
1151
|
+
}, Yt = {
|
|
1131
1152
|
key: 4,
|
|
1132
1153
|
class: "passkey-binding__toolbar"
|
|
1133
|
-
},
|
|
1154
|
+
}, Jt = /* @__PURE__ */ J({
|
|
1134
1155
|
__name: "AuthkitPasskeyBinding",
|
|
1135
1156
|
props: {
|
|
1136
1157
|
size: {
|
|
@@ -1141,13 +1162,13 @@ const Ht = {
|
|
|
1141
1162
|
setup(e) {
|
|
1142
1163
|
const i = e, {
|
|
1143
1164
|
userProfile: a
|
|
1144
|
-
} = ne(),
|
|
1165
|
+
} = ne(), s = A(!1), l = A(!1), d = A([]), r = se(), {
|
|
1145
1166
|
registerPasskey: t,
|
|
1146
|
-
formatError:
|
|
1147
|
-
} =
|
|
1167
|
+
formatError: v
|
|
1168
|
+
} = Ht(), g = A(""), f = A(!1), h = A(), u = $(() => {
|
|
1148
1169
|
var _, P;
|
|
1149
1170
|
return !!((_ = a.value) != null && _.email || (P = a.value) != null && P.phone);
|
|
1150
|
-
}), p = $(() =>
|
|
1171
|
+
}), p = $(() => u.value && !h.value), S = [{
|
|
1151
1172
|
title: "通行密钥",
|
|
1152
1173
|
dataIndex: "name",
|
|
1153
1174
|
minWidth: fe.name,
|
|
@@ -1175,49 +1196,49 @@ const Ht = {
|
|
|
1175
1196
|
cellClassName: "passkey-actions-cell"
|
|
1176
1197
|
}];
|
|
1177
1198
|
async function R() {
|
|
1178
|
-
|
|
1199
|
+
s.value = !0;
|
|
1179
1200
|
const {
|
|
1180
1201
|
data: _,
|
|
1181
1202
|
error: P
|
|
1182
1203
|
} = await x().auth.passkey.list.post();
|
|
1183
|
-
if (
|
|
1204
|
+
if (s.value = !1, P || !_) {
|
|
1184
1205
|
d.value = [];
|
|
1185
1206
|
return;
|
|
1186
1207
|
}
|
|
1187
1208
|
d.value = _.list;
|
|
1188
1209
|
}
|
|
1189
1210
|
async function B() {
|
|
1190
|
-
|
|
1211
|
+
l.value = !0;
|
|
1191
1212
|
try {
|
|
1192
1213
|
if (!await t())
|
|
1193
1214
|
return;
|
|
1194
1215
|
G.success("Passkey 添加成功"), await R();
|
|
1195
1216
|
} catch (_) {
|
|
1196
|
-
G.error(
|
|
1217
|
+
G.error(v(_));
|
|
1197
1218
|
} finally {
|
|
1198
|
-
|
|
1219
|
+
l.value = !1;
|
|
1199
1220
|
}
|
|
1200
1221
|
}
|
|
1201
1222
|
function K(_) {
|
|
1202
1223
|
var P, N, F;
|
|
1203
|
-
if (g.value = _, f.value = !1, !
|
|
1224
|
+
if (g.value = _, f.value = !1, !u.value) {
|
|
1204
1225
|
q();
|
|
1205
1226
|
return;
|
|
1206
1227
|
}
|
|
1207
1228
|
if ((P = a.value) != null && P.email && ((N = a.value) != null && N.phone)) {
|
|
1208
|
-
|
|
1229
|
+
h.value = void 0;
|
|
1209
1230
|
return;
|
|
1210
1231
|
}
|
|
1211
|
-
|
|
1232
|
+
h.value = (F = a.value) != null && F.email ? "email" : "phone";
|
|
1212
1233
|
}
|
|
1213
1234
|
function j(_) {
|
|
1214
|
-
|
|
1235
|
+
h.value = _;
|
|
1215
1236
|
}
|
|
1216
1237
|
function V() {
|
|
1217
1238
|
f.value = !0, q();
|
|
1218
1239
|
}
|
|
1219
1240
|
function w() {
|
|
1220
|
-
g.value = "", f.value = !1,
|
|
1241
|
+
g.value = "", f.value = !1, h.value = void 0;
|
|
1221
1242
|
}
|
|
1222
1243
|
async function q() {
|
|
1223
1244
|
if (!g.value)
|
|
@@ -1233,7 +1254,7 @@ const Ht = {
|
|
|
1233
1254
|
R();
|
|
1234
1255
|
}), (_, P) => {
|
|
1235
1256
|
var N, F;
|
|
1236
|
-
return y(), M("div",
|
|
1257
|
+
return y(), M("div", Wt, [m(n(Y), {
|
|
1237
1258
|
type: "info",
|
|
1238
1259
|
style: {
|
|
1239
1260
|
"margin-bottom": "16px"
|
|
@@ -1241,11 +1262,11 @@ const Ht = {
|
|
|
1241
1262
|
}, {
|
|
1242
1263
|
default: o(() => [...P[2] || (P[2] = [k(" Passkey 使用设备生物识别(指纹 / 面容)登录,绑定后可在登录页一键验证身份。 ", -1)])]),
|
|
1243
1264
|
_: 1
|
|
1244
|
-
}), n(
|
|
1265
|
+
}), n(r) ? (y(), M("div", Gt, U(n(r)), 1)) : C("", !0), g.value && !f.value ? (y(), I(n(Y), {
|
|
1245
1266
|
key: 1,
|
|
1246
1267
|
type: "warning",
|
|
1247
1268
|
title: "移除前验证身份"
|
|
1248
|
-
},
|
|
1269
|
+
}, He({
|
|
1249
1270
|
default: o(() => [P[6] || (P[6] = k(" 移除 Passkey 前请先完成身份验证。 ", -1))]),
|
|
1250
1271
|
_: 2
|
|
1251
1272
|
}, [p.value ? {
|
|
@@ -1261,7 +1282,7 @@ const Ht = {
|
|
|
1261
1282
|
}, {
|
|
1262
1283
|
default: o(() => [...P[3] || (P[3] = [k(" 邮箱验证 ", -1)])]),
|
|
1263
1284
|
_: 1
|
|
1264
|
-
}, 8, ["size"])) :
|
|
1285
|
+
}, 8, ["size"])) : C("", !0), (Z = n(a)) != null && Z.phone ? (y(), I(n(T), {
|
|
1265
1286
|
key: 1,
|
|
1266
1287
|
size: i.size,
|
|
1267
1288
|
type: "primary",
|
|
@@ -1269,7 +1290,7 @@ const Ht = {
|
|
|
1269
1290
|
}, {
|
|
1270
1291
|
default: o(() => [...P[4] || (P[4] = [k(" 手机验证 ", -1)])]),
|
|
1271
1292
|
_: 1
|
|
1272
|
-
}, 8, ["size"])) :
|
|
1293
|
+
}, 8, ["size"])) : C("", !0), m(n(T), {
|
|
1273
1294
|
size: i.size,
|
|
1274
1295
|
onClick: w
|
|
1275
1296
|
}, {
|
|
@@ -1280,30 +1301,30 @@ const Ht = {
|
|
|
1280
1301
|
_: 1
|
|
1281
1302
|
})]),
|
|
1282
1303
|
key: "0"
|
|
1283
|
-
} : void 0]), 1024)) :
|
|
1304
|
+
} : void 0]), 1024)) : C("", !0), g.value && h.value === "email" && ((N = n(a)) != null && N.email) ? (y(), I(ge, {
|
|
1284
1305
|
key: 2,
|
|
1285
1306
|
size: i.size,
|
|
1286
1307
|
email: n(a).email,
|
|
1287
1308
|
onNext: V
|
|
1288
|
-
}, null, 8, ["size", "email"])) :
|
|
1309
|
+
}, null, 8, ["size", "email"])) : C("", !0), g.value && h.value === "phone" && ((F = n(a)) != null && F.phone) ? (y(), I(we, {
|
|
1289
1310
|
key: 3,
|
|
1290
1311
|
size: i.size,
|
|
1291
1312
|
phone: n(a).phone,
|
|
1292
1313
|
onNext: V
|
|
1293
|
-
}, null, 8, ["size", "phone"])) :
|
|
1314
|
+
}, null, 8, ["size", "phone"])) : C("", !0), g.value ? C("", !0) : (y(), M("div", Yt, [m(n(T), {
|
|
1294
1315
|
type: "primary",
|
|
1295
1316
|
size: i.size,
|
|
1296
|
-
loading:
|
|
1297
|
-
disabled: !!n(
|
|
1317
|
+
loading: l.value,
|
|
1318
|
+
disabled: !!n(r),
|
|
1298
1319
|
onClick: B
|
|
1299
1320
|
}, {
|
|
1300
1321
|
default: o(() => [...P[7] || (P[7] = [k(" 添加 Passkey ", -1)])]),
|
|
1301
1322
|
_: 1
|
|
1302
|
-
}, 8, ["size", "loading", "disabled"])])), g.value ?
|
|
1323
|
+
}, 8, ["size", "loading", "disabled"])])), g.value ? C("", !0) : (y(), I(tt, {
|
|
1303
1324
|
key: 5,
|
|
1304
1325
|
columns: S,
|
|
1305
1326
|
data: d.value,
|
|
1306
|
-
loading:
|
|
1327
|
+
loading: s.value,
|
|
1307
1328
|
pagination: !1,
|
|
1308
1329
|
bordered: !1,
|
|
1309
1330
|
"row-key": "credentialId"
|
|
@@ -1316,7 +1337,7 @@ const Ht = {
|
|
|
1316
1337
|
}) => [k(U(D.createdAt || "-"), 1)]),
|
|
1317
1338
|
actions: o(({
|
|
1318
1339
|
record: D
|
|
1319
|
-
}) => [m(n(
|
|
1340
|
+
}) => [m(n(Ye), {
|
|
1320
1341
|
content: "确定移除此 Passkey?移除后将无法使用该设备登录",
|
|
1321
1342
|
onOk: (Z) => K(D.credentialId)
|
|
1322
1343
|
}, {
|
|
@@ -1334,18 +1355,18 @@ const Ht = {
|
|
|
1334
1355
|
}, 8, ["data", "loading"]))]);
|
|
1335
1356
|
};
|
|
1336
1357
|
}
|
|
1337
|
-
}),
|
|
1358
|
+
}), jt = /* @__PURE__ */ X(Jt, [["__scopeId", "data-v-08d3a331"]]), Qt = {
|
|
1338
1359
|
class: "BindEmail"
|
|
1339
|
-
}, Qt = {
|
|
1340
|
-
class: "content"
|
|
1341
1360
|
}, Xt = {
|
|
1342
|
-
class: "
|
|
1361
|
+
class: "content"
|
|
1343
1362
|
}, Zt = {
|
|
1344
|
-
class: "
|
|
1363
|
+
class: "sendVerifyCodeItem"
|
|
1345
1364
|
}, ei = {
|
|
1365
|
+
class: "handle"
|
|
1366
|
+
}, ti = {
|
|
1346
1367
|
key: 0,
|
|
1347
1368
|
class: "skip"
|
|
1348
|
-
},
|
|
1369
|
+
}, ii = /* @__PURE__ */ J({
|
|
1349
1370
|
__name: "AuthkitBindEmail",
|
|
1350
1371
|
props: {
|
|
1351
1372
|
size: {
|
|
@@ -1379,24 +1400,24 @@ const Ht = {
|
|
|
1379
1400
|
setup(e, {
|
|
1380
1401
|
emit: i
|
|
1381
1402
|
}) {
|
|
1382
|
-
const a = i,
|
|
1403
|
+
const a = i, s = e, l = A(), d = A(!1), r = A(), t = A({
|
|
1383
1404
|
email: void 0,
|
|
1384
1405
|
userToken: void 0,
|
|
1385
1406
|
emailVerifyId: void 0
|
|
1386
1407
|
});
|
|
1387
|
-
async function
|
|
1388
|
-
if (!await
|
|
1408
|
+
async function v() {
|
|
1409
|
+
if (!await r.value.validateField(["email"])) {
|
|
1389
1410
|
d.value = !0;
|
|
1390
|
-
const
|
|
1411
|
+
const u = await x().auth.verify.email.retry.post({
|
|
1391
1412
|
email: t.value.email,
|
|
1392
1413
|
purpose: "bindEmail"
|
|
1393
1414
|
});
|
|
1394
|
-
d.value = !1,
|
|
1415
|
+
d.value = !1, u.data && (t.value.emailVerifyId = u.data.emailVerifyId), ye(l.value, u);
|
|
1395
1416
|
}
|
|
1396
1417
|
}
|
|
1397
1418
|
async function g() {
|
|
1398
|
-
|
|
1399
|
-
|
|
1419
|
+
r.value.validate().then((h) => {
|
|
1420
|
+
h || a("submit", {
|
|
1400
1421
|
email: t.value.email,
|
|
1401
1422
|
userToken: t.value.userToken,
|
|
1402
1423
|
emailVerifyId: t.value.emailVerifyId
|
|
@@ -1406,17 +1427,17 @@ const Ht = {
|
|
|
1406
1427
|
function f() {
|
|
1407
1428
|
a("skip");
|
|
1408
1429
|
}
|
|
1409
|
-
return (
|
|
1430
|
+
return (h, u) => (y(), M("div", Qt, [m(n(Y), {
|
|
1410
1431
|
type: "info",
|
|
1411
|
-
title:
|
|
1432
|
+
title: s.title
|
|
1412
1433
|
}, {
|
|
1413
|
-
default: o(() => [k(U(
|
|
1434
|
+
default: o(() => [k(U(s.subtitle), 1)]),
|
|
1414
1435
|
_: 1
|
|
1415
|
-
}, 8, ["title"]), z("div",
|
|
1436
|
+
}, 8, ["title"]), z("div", Xt, [m(n(le), {
|
|
1416
1437
|
ref_key: "formRef",
|
|
1417
|
-
ref:
|
|
1438
|
+
ref: r,
|
|
1418
1439
|
model: t.value,
|
|
1419
|
-
size:
|
|
1440
|
+
size: s.size,
|
|
1420
1441
|
"auto-label-width": ""
|
|
1421
1442
|
}, {
|
|
1422
1443
|
default: o(() => [m(n(L), {
|
|
@@ -1433,7 +1454,7 @@ const Ht = {
|
|
|
1433
1454
|
}, {
|
|
1434
1455
|
default: o(() => [m(n(Q), {
|
|
1435
1456
|
modelValue: t.value.email,
|
|
1436
|
-
"onUpdate:modelValue":
|
|
1457
|
+
"onUpdate:modelValue": u[0] || (u[0] = (p) => t.value.email = p),
|
|
1437
1458
|
placeholder: "请输入邮箱",
|
|
1438
1459
|
autocomplete: "email",
|
|
1439
1460
|
type: "email"
|
|
@@ -1448,41 +1469,41 @@ const Ht = {
|
|
|
1448
1469
|
message: "请输入验证码"
|
|
1449
1470
|
}]
|
|
1450
1471
|
}, {
|
|
1451
|
-
default: o(() => [z("div",
|
|
1472
|
+
default: o(() => [z("div", Zt, [m(n(Q), {
|
|
1452
1473
|
modelValue: t.value.userToken,
|
|
1453
|
-
"onUpdate:modelValue":
|
|
1474
|
+
"onUpdate:modelValue": u[1] || (u[1] = (p) => t.value.userToken = p),
|
|
1454
1475
|
placeholder: "请输入验证码",
|
|
1455
1476
|
autocomplete: "one-time-code"
|
|
1456
1477
|
}, null, 8, ["modelValue"]), m(he, {
|
|
1457
1478
|
ref_key: "SendVerifyCodeRef",
|
|
1458
|
-
ref:
|
|
1459
|
-
size:
|
|
1479
|
+
ref: l,
|
|
1480
|
+
size: s.size,
|
|
1460
1481
|
loading: d.value,
|
|
1461
1482
|
style: {
|
|
1462
1483
|
"margin-left": "10px"
|
|
1463
1484
|
},
|
|
1464
|
-
onSend:
|
|
1485
|
+
onSend: v
|
|
1465
1486
|
}, null, 8, ["size", "loading"])])]),
|
|
1466
1487
|
_: 1
|
|
1467
|
-
}), z("div",
|
|
1488
|
+
}), z("div", ei, [m(n(T), {
|
|
1468
1489
|
type: "primary",
|
|
1469
|
-
loading:
|
|
1490
|
+
loading: s.loading,
|
|
1470
1491
|
long: "",
|
|
1471
|
-
size:
|
|
1492
|
+
size: s.size,
|
|
1472
1493
|
onClick: g
|
|
1473
1494
|
}, {
|
|
1474
|
-
default: o(() => [k(U(
|
|
1495
|
+
default: o(() => [k(U(s.submitText), 1)]),
|
|
1475
1496
|
_: 1
|
|
1476
1497
|
}, 8, ["loading", "size"])])]),
|
|
1477
1498
|
_: 1
|
|
1478
|
-
}, 8, ["model", "size"])]),
|
|
1499
|
+
}, 8, ["model", "size"])]), s.showSkip ? (y(), M("div", ti, [m(n(Re), {
|
|
1479
1500
|
onClick: f
|
|
1480
1501
|
}, {
|
|
1481
|
-
default: o(() => [...
|
|
1502
|
+
default: o(() => [...u[2] || (u[2] = [k("稍后绑定", -1)])]),
|
|
1482
1503
|
_: 1
|
|
1483
|
-
})])) :
|
|
1504
|
+
})])) : C("", !0)]));
|
|
1484
1505
|
}
|
|
1485
|
-
}),
|
|
1506
|
+
}), ni = /* @__PURE__ */ X(ii, [["__scopeId", "data-v-00ac3b6a"]]), ai = /* @__PURE__ */ J({
|
|
1486
1507
|
__name: "AuthkitEmailBinding",
|
|
1487
1508
|
props: {
|
|
1488
1509
|
size: {
|
|
@@ -1494,84 +1515,84 @@ const Ht = {
|
|
|
1494
1515
|
const {
|
|
1495
1516
|
userProfile: i,
|
|
1496
1517
|
loading: a,
|
|
1497
|
-
fetchUserProfile:
|
|
1498
|
-
} = ne(),
|
|
1499
|
-
var
|
|
1500
|
-
return !!((
|
|
1518
|
+
fetchUserProfile: s
|
|
1519
|
+
} = ne(), l = A("hidden"), d = A(!1), r = e, t = $(() => {
|
|
1520
|
+
var h;
|
|
1521
|
+
return !!((h = i.value) != null && h.email) && d.value;
|
|
1501
1522
|
});
|
|
1502
|
-
function h
|
|
1503
|
-
|
|
1523
|
+
function v(h) {
|
|
1524
|
+
l.value = h;
|
|
1504
1525
|
}
|
|
1505
|
-
async function g(
|
|
1526
|
+
async function g(h) {
|
|
1506
1527
|
a.value = !0;
|
|
1507
|
-
const
|
|
1508
|
-
email:
|
|
1509
|
-
userToken:
|
|
1510
|
-
emailVerifyId:
|
|
1528
|
+
const u = t.value ? x().auth.users.update.myEmail.post({
|
|
1529
|
+
email: h.email,
|
|
1530
|
+
userToken: h.userToken,
|
|
1531
|
+
emailVerifyId: h.emailVerifyId
|
|
1511
1532
|
}) : x().auth.auth.bind.email.post({
|
|
1512
|
-
email:
|
|
1513
|
-
userToken:
|
|
1514
|
-
emailVerifyId:
|
|
1533
|
+
email: h.email,
|
|
1534
|
+
userToken: h.userToken,
|
|
1535
|
+
emailVerifyId: h.emailVerifyId
|
|
1515
1536
|
}), {
|
|
1516
1537
|
error: p
|
|
1517
|
-
} = await
|
|
1518
|
-
a.value = !1, p || (G.success(t.value ? "更改成功" : "绑定成功"),
|
|
1538
|
+
} = await u;
|
|
1539
|
+
a.value = !1, p || (G.success(t.value ? "更改成功" : "绑定成功"), l.value = "hidden", d.value = !1, s());
|
|
1519
1540
|
}
|
|
1520
1541
|
function f() {
|
|
1521
|
-
d.value = !0,
|
|
1542
|
+
d.value = !0, l.value = "update";
|
|
1522
1543
|
}
|
|
1523
1544
|
return de(() => {
|
|
1524
|
-
i.value ||
|
|
1525
|
-
}), (
|
|
1545
|
+
i.value || s();
|
|
1546
|
+
}), (h, u) => {
|
|
1526
1547
|
var p, S, R;
|
|
1527
|
-
return y(), M(ie, null, [(p = n(i)) != null && p.email &&
|
|
1548
|
+
return y(), M(ie, null, [(p = n(i)) != null && p.email && l.value === "hidden" ? (y(), I(n(Y), {
|
|
1528
1549
|
key: 0,
|
|
1529
1550
|
title: "更改邮箱"
|
|
1530
1551
|
}, {
|
|
1531
1552
|
action: o(() => [m(n(T), {
|
|
1532
|
-
size:
|
|
1553
|
+
size: r.size,
|
|
1533
1554
|
type: "primary",
|
|
1534
|
-
onClick:
|
|
1555
|
+
onClick: u[0] || (u[0] = (B) => v("verify"))
|
|
1535
1556
|
}, {
|
|
1536
|
-
default: o(() => [...
|
|
1557
|
+
default: o(() => [...u[1] || (u[1] = [k("更改邮箱", -1)])]),
|
|
1537
1558
|
_: 1
|
|
1538
1559
|
}, 8, ["size"])]),
|
|
1539
|
-
default: o(() => [k(U(`您绑定的邮箱为 ${n(
|
|
1560
|
+
default: o(() => [k(U(`您绑定的邮箱为 ${n(Se)(n(i).email)}`) + " ", 1)]),
|
|
1540
1561
|
_: 1
|
|
1541
|
-
})) :
|
|
1562
|
+
})) : C("", !0), !((S = n(i)) != null && S.email) || l.value === "update" ? (y(), I(ni, {
|
|
1542
1563
|
key: 1,
|
|
1543
1564
|
loading: n(a),
|
|
1544
|
-
size:
|
|
1565
|
+
size: r.size,
|
|
1545
1566
|
title: t.value ? "更改邮箱" : "绑定邮箱",
|
|
1546
1567
|
subtitle: t.value ? "请输入新的邮箱并完成验证" : "请绑定邮箱以完成账号设置,绑定后可使用邮箱登录",
|
|
1547
1568
|
"submit-text": t.value ? "更改邮箱" : "绑定邮箱",
|
|
1548
1569
|
onSubmit: g
|
|
1549
|
-
}, null, 8, ["loading", "size", "title", "subtitle", "submit-text"])) :
|
|
1570
|
+
}, null, 8, ["loading", "size", "title", "subtitle", "submit-text"])) : C("", !0), l.value === "verify" ? (y(), I(ge, {
|
|
1550
1571
|
key: 2,
|
|
1551
|
-
size:
|
|
1572
|
+
size: r.size,
|
|
1552
1573
|
email: (R = n(i)) == null ? void 0 : R.email,
|
|
1553
1574
|
onNext: f
|
|
1554
|
-
}, null, 8, ["size", "email"])) :
|
|
1575
|
+
}, null, 8, ["size", "email"])) : C("", !0)], 64);
|
|
1555
1576
|
};
|
|
1556
1577
|
}
|
|
1557
|
-
}),
|
|
1578
|
+
}), oi = {
|
|
1558
1579
|
class: "BindPhone"
|
|
1559
|
-
}, oi = {
|
|
1560
|
-
class: "header"
|
|
1561
1580
|
}, si = {
|
|
1562
|
-
class: "
|
|
1581
|
+
class: "header"
|
|
1563
1582
|
}, li = {
|
|
1564
|
-
class: "
|
|
1583
|
+
class: "title"
|
|
1565
1584
|
}, ri = {
|
|
1566
|
-
class: "
|
|
1585
|
+
class: "subtitle"
|
|
1567
1586
|
}, ui = {
|
|
1568
|
-
class: "
|
|
1587
|
+
class: "content"
|
|
1569
1588
|
}, di = {
|
|
1570
|
-
class: "
|
|
1589
|
+
class: "sendVerifyCodeItem"
|
|
1571
1590
|
}, ci = {
|
|
1591
|
+
class: "handle"
|
|
1592
|
+
}, fi = {
|
|
1572
1593
|
key: 0,
|
|
1573
1594
|
class: "skip"
|
|
1574
|
-
},
|
|
1595
|
+
}, pi = /* @__PURE__ */ J({
|
|
1575
1596
|
__name: "AuthkitBindPhone",
|
|
1576
1597
|
props: {
|
|
1577
1598
|
size: {
|
|
@@ -1604,23 +1625,23 @@ const Ht = {
|
|
|
1604
1625
|
setup(e, {
|
|
1605
1626
|
emit: i
|
|
1606
1627
|
}) {
|
|
1607
|
-
const a = i,
|
|
1628
|
+
const a = i, s = e, l = A(), d = A(!1), r = A(), t = A({
|
|
1608
1629
|
phone: void 0,
|
|
1609
1630
|
code: void 0
|
|
1610
1631
|
});
|
|
1611
|
-
async function
|
|
1612
|
-
if (!await
|
|
1632
|
+
async function v() {
|
|
1633
|
+
if (!await r.value.validateField(["phone"])) {
|
|
1613
1634
|
d.value = !0;
|
|
1614
|
-
const
|
|
1635
|
+
const u = await x().auth.verify.sms.send.post({
|
|
1615
1636
|
phone: t.value.phone,
|
|
1616
1637
|
purpose: "bindPhone"
|
|
1617
1638
|
});
|
|
1618
|
-
d.value = !1, ye(
|
|
1639
|
+
d.value = !1, ye(l.value, u);
|
|
1619
1640
|
}
|
|
1620
1641
|
}
|
|
1621
1642
|
async function g() {
|
|
1622
|
-
|
|
1623
|
-
|
|
1643
|
+
r.value.validate().then((h) => {
|
|
1644
|
+
h || a("submit", {
|
|
1624
1645
|
phone: t.value.phone,
|
|
1625
1646
|
code: t.value.code
|
|
1626
1647
|
});
|
|
@@ -1629,11 +1650,11 @@ const Ht = {
|
|
|
1629
1650
|
function f() {
|
|
1630
1651
|
a("skip");
|
|
1631
1652
|
}
|
|
1632
|
-
return (
|
|
1653
|
+
return (h, u) => (y(), M("div", oi, [z("div", si, [z("h3", li, U(s.title), 1), z("p", ri, U(s.subtitle), 1)]), z("div", ui, [m(n(le), {
|
|
1633
1654
|
ref_key: "formRef",
|
|
1634
|
-
ref:
|
|
1655
|
+
ref: r,
|
|
1635
1656
|
model: t.value,
|
|
1636
|
-
size:
|
|
1657
|
+
size: s.size,
|
|
1637
1658
|
"auto-label-width": ""
|
|
1638
1659
|
}, {
|
|
1639
1660
|
default: o(() => [m(n(L), {
|
|
@@ -1650,7 +1671,7 @@ const Ht = {
|
|
|
1650
1671
|
}, {
|
|
1651
1672
|
default: o(() => [m(n(Q), {
|
|
1652
1673
|
modelValue: t.value.phone,
|
|
1653
|
-
"onUpdate:modelValue":
|
|
1674
|
+
"onUpdate:modelValue": u[0] || (u[0] = (p) => t.value.phone = p),
|
|
1654
1675
|
placeholder: "请输入手机号",
|
|
1655
1676
|
autocomplete: "tel",
|
|
1656
1677
|
type: "tel"
|
|
@@ -1665,41 +1686,41 @@ const Ht = {
|
|
|
1665
1686
|
message: "请输入验证码"
|
|
1666
1687
|
}]
|
|
1667
1688
|
}, {
|
|
1668
|
-
default: o(() => [z("div",
|
|
1689
|
+
default: o(() => [z("div", di, [m(n(Q), {
|
|
1669
1690
|
modelValue: t.value.code,
|
|
1670
|
-
"onUpdate:modelValue":
|
|
1691
|
+
"onUpdate:modelValue": u[1] || (u[1] = (p) => t.value.code = p),
|
|
1671
1692
|
placeholder: "请输入验证码",
|
|
1672
1693
|
autocomplete: "one-time-code"
|
|
1673
1694
|
}, null, 8, ["modelValue"]), m(he, {
|
|
1674
1695
|
ref_key: "SendVerifyCodeRef",
|
|
1675
|
-
ref:
|
|
1676
|
-
size:
|
|
1696
|
+
ref: l,
|
|
1697
|
+
size: s.size,
|
|
1677
1698
|
loading: d.value,
|
|
1678
1699
|
style: {
|
|
1679
1700
|
"margin-left": "10px"
|
|
1680
1701
|
},
|
|
1681
|
-
onSend:
|
|
1702
|
+
onSend: v
|
|
1682
1703
|
}, null, 8, ["size", "loading"])])]),
|
|
1683
1704
|
_: 1
|
|
1684
|
-
}), z("div",
|
|
1705
|
+
}), z("div", ci, [m(n(T), {
|
|
1685
1706
|
type: "primary",
|
|
1686
|
-
loading:
|
|
1707
|
+
loading: s.loading,
|
|
1687
1708
|
long: "",
|
|
1688
|
-
size:
|
|
1709
|
+
size: s.size,
|
|
1689
1710
|
onClick: g
|
|
1690
1711
|
}, {
|
|
1691
|
-
default: o(() => [k(U(
|
|
1712
|
+
default: o(() => [k(U(s.submitText), 1)]),
|
|
1692
1713
|
_: 1
|
|
1693
1714
|
}, 8, ["loading", "size"])])]),
|
|
1694
1715
|
_: 1
|
|
1695
|
-
}, 8, ["model", "size"])]),
|
|
1716
|
+
}, 8, ["model", "size"])]), s.showSkip ? (y(), M("div", fi, [m(n(Re), {
|
|
1696
1717
|
onClick: f
|
|
1697
1718
|
}, {
|
|
1698
|
-
default: o(() => [...
|
|
1719
|
+
default: o(() => [...u[2] || (u[2] = [k("稍后绑定", -1)])]),
|
|
1699
1720
|
_: 1
|
|
1700
|
-
})])) :
|
|
1721
|
+
})])) : C("", !0)]));
|
|
1701
1722
|
}
|
|
1702
|
-
}),
|
|
1723
|
+
}), mi = /* @__PURE__ */ X(pi, [["__scopeId", "data-v-1db8897d"]]), vi = /* @__PURE__ */ J({
|
|
1703
1724
|
__name: "AuthkitPhoneBinding",
|
|
1704
1725
|
props: {
|
|
1705
1726
|
size: {
|
|
@@ -1711,45 +1732,45 @@ const Ht = {
|
|
|
1711
1732
|
const {
|
|
1712
1733
|
userProfile: i,
|
|
1713
1734
|
loading: a,
|
|
1714
|
-
fetchUserProfile:
|
|
1715
|
-
} = ne(),
|
|
1735
|
+
fetchUserProfile: s
|
|
1736
|
+
} = ne(), l = A("hidden"), d = A(!1), r = e, t = $(() => {
|
|
1716
1737
|
var p;
|
|
1717
|
-
const
|
|
1718
|
-
return
|
|
1719
|
-
}),
|
|
1720
|
-
var
|
|
1721
|
-
return !!((
|
|
1738
|
+
const u = ((p = i.value) == null ? void 0 : p.phone) || "";
|
|
1739
|
+
return u.length < 7 ? u : `${u.slice(0, 3)}****${u.slice(-4)}`;
|
|
1740
|
+
}), v = $(() => {
|
|
1741
|
+
var u;
|
|
1742
|
+
return !!((u = i.value) != null && u.phone) && d.value;
|
|
1722
1743
|
});
|
|
1723
|
-
function g(
|
|
1744
|
+
function g(u) {
|
|
1724
1745
|
var p;
|
|
1725
|
-
|
|
1746
|
+
l.value = u, u === "update" && !((p = i.value) != null && p.phone) && (d.value = !1);
|
|
1726
1747
|
}
|
|
1727
|
-
async function f(
|
|
1748
|
+
async function f(u) {
|
|
1728
1749
|
a.value = !0;
|
|
1729
|
-
const p =
|
|
1730
|
-
phone:
|
|
1731
|
-
code:
|
|
1750
|
+
const p = v.value ? x().auth.users.update.myPhone.post({
|
|
1751
|
+
phone: u.phone,
|
|
1752
|
+
code: u.code
|
|
1732
1753
|
}) : x().auth.auth.bind.phone.post({
|
|
1733
|
-
phone:
|
|
1734
|
-
code:
|
|
1754
|
+
phone: u.phone,
|
|
1755
|
+
code: u.code
|
|
1735
1756
|
}), {
|
|
1736
1757
|
error: S
|
|
1737
1758
|
} = await p;
|
|
1738
|
-
a.value = !1, S || (G.success(
|
|
1759
|
+
a.value = !1, S || (G.success(v.value ? "更改成功" : "绑定成功"), l.value = "hidden", d.value = !1, s());
|
|
1739
1760
|
}
|
|
1740
|
-
function
|
|
1741
|
-
d.value = !0,
|
|
1761
|
+
function h() {
|
|
1762
|
+
d.value = !0, l.value = "update";
|
|
1742
1763
|
}
|
|
1743
1764
|
return de(() => {
|
|
1744
|
-
i.value ||
|
|
1745
|
-
}), (
|
|
1765
|
+
i.value || s();
|
|
1766
|
+
}), (u, p) => {
|
|
1746
1767
|
var S, R, B;
|
|
1747
|
-
return y(), M(ie, null, [!((S = n(i)) != null && S.phone) &&
|
|
1768
|
+
return y(), M(ie, null, [!((S = n(i)) != null && S.phone) && l.value === "hidden" ? (y(), I(n(Y), {
|
|
1748
1769
|
key: 0,
|
|
1749
1770
|
title: "绑定手机号"
|
|
1750
1771
|
}, {
|
|
1751
1772
|
action: o(() => [m(n(T), {
|
|
1752
|
-
size:
|
|
1773
|
+
size: r.size,
|
|
1753
1774
|
type: "primary",
|
|
1754
1775
|
onClick: p[0] || (p[0] = (K) => g("update"))
|
|
1755
1776
|
}, {
|
|
@@ -1758,12 +1779,12 @@ const Ht = {
|
|
|
1758
1779
|
}, 8, ["size"])]),
|
|
1759
1780
|
default: o(() => [p[3] || (p[3] = k(" 您还未绑定手机号,请点击绑定手机号。 ", -1))]),
|
|
1760
1781
|
_: 1
|
|
1761
|
-
})) :
|
|
1782
|
+
})) : C("", !0), (R = n(i)) != null && R.phone && l.value === "hidden" ? (y(), I(n(Y), {
|
|
1762
1783
|
key: 1,
|
|
1763
1784
|
title: "已绑定手机号"
|
|
1764
1785
|
}, {
|
|
1765
1786
|
action: o(() => [m(n(T), {
|
|
1766
|
-
size:
|
|
1787
|
+
size: r.size,
|
|
1767
1788
|
type: "primary",
|
|
1768
1789
|
onClick: p[1] || (p[1] = (K) => g("verify"))
|
|
1769
1790
|
}, {
|
|
@@ -1772,54 +1793,54 @@ const Ht = {
|
|
|
1772
1793
|
}, 8, ["size"])]),
|
|
1773
1794
|
default: o(() => [k(U(`您绑定的手机号为 ${t.value}`) + " ", 1)]),
|
|
1774
1795
|
_: 1
|
|
1775
|
-
})) :
|
|
1796
|
+
})) : C("", !0), l.value === "update" ? (y(), I(mi, {
|
|
1776
1797
|
key: 2,
|
|
1777
1798
|
loading: n(a),
|
|
1778
|
-
size:
|
|
1779
|
-
title:
|
|
1780
|
-
subtitle:
|
|
1781
|
-
"submit-text":
|
|
1799
|
+
size: r.size,
|
|
1800
|
+
title: v.value ? "更改手机号" : "绑定手机号",
|
|
1801
|
+
subtitle: v.value ? "请输入新的手机号并完成短信验证" : "请绑定手机号以完成账号设置",
|
|
1802
|
+
"submit-text": v.value ? "更改手机号" : "绑定手机号",
|
|
1782
1803
|
onSubmit: f
|
|
1783
|
-
}, null, 8, ["loading", "size", "title", "subtitle", "submit-text"])) :
|
|
1804
|
+
}, null, 8, ["loading", "size", "title", "subtitle", "submit-text"])) : C("", !0), l.value === "verify" ? (y(), I(we, {
|
|
1784
1805
|
key: 3,
|
|
1785
|
-
size:
|
|
1806
|
+
size: r.size,
|
|
1786
1807
|
phone: ((B = n(i)) == null ? void 0 : B.phone) || "",
|
|
1787
|
-
onNext:
|
|
1788
|
-
}, null, 8, ["size", "phone"])) :
|
|
1808
|
+
onNext: h
|
|
1809
|
+
}, null, 8, ["size", "phone"])) : C("", !0)], 64);
|
|
1789
1810
|
};
|
|
1790
1811
|
}
|
|
1791
1812
|
});
|
|
1792
|
-
function
|
|
1813
|
+
function hi() {
|
|
1793
1814
|
var i;
|
|
1794
1815
|
return typeof window > "u" ? "" : ((i = new URLSearchParams(window.location.search).get("inviteCode")) == null ? void 0 : i.trim()) || "";
|
|
1795
1816
|
}
|
|
1796
1817
|
const ze = ["token", "refreshToken", "userId", "appId", "error", "needBindIdentity", "bindSuccess", "provider", "expiresIn"], ue = "auth_redirect";
|
|
1797
|
-
function
|
|
1818
|
+
function yi(e) {
|
|
1798
1819
|
return ze.some((i) => e.searchParams.has(i));
|
|
1799
1820
|
}
|
|
1800
|
-
function
|
|
1821
|
+
function wn(e) {
|
|
1801
1822
|
return ze.forEach((i) => e.searchParams.delete(i)), `${e.pathname}${e.search}${e.hash}`;
|
|
1802
1823
|
}
|
|
1803
|
-
function
|
|
1824
|
+
function Be() {
|
|
1804
1825
|
return new URL(window.location.href);
|
|
1805
1826
|
}
|
|
1806
|
-
function
|
|
1807
|
-
const e =
|
|
1827
|
+
function qe() {
|
|
1828
|
+
const e = Be();
|
|
1808
1829
|
return ze.forEach((i) => e.searchParams.delete(i)), `${e.origin}${e.pathname}${e.search}${e.hash}`;
|
|
1809
1830
|
}
|
|
1810
|
-
function
|
|
1831
|
+
function gi() {
|
|
1811
1832
|
return `${window.location.origin}/`;
|
|
1812
1833
|
}
|
|
1813
|
-
function
|
|
1834
|
+
function wi() {
|
|
1814
1835
|
if (typeof window > "u")
|
|
1815
1836
|
return;
|
|
1816
|
-
const e =
|
|
1817
|
-
if (
|
|
1837
|
+
const e = Be();
|
|
1838
|
+
if (yi(e))
|
|
1818
1839
|
return;
|
|
1819
1840
|
const i = `${e.pathname}${e.search}${e.hash}`;
|
|
1820
1841
|
sessionStorage.setItem(ue, i);
|
|
1821
1842
|
}
|
|
1822
|
-
function
|
|
1843
|
+
function bn(e) {
|
|
1823
1844
|
if (!e || typeof window > "u")
|
|
1824
1845
|
return null;
|
|
1825
1846
|
const i = sessionStorage.getItem(ue);
|
|
@@ -1828,34 +1849,34 @@ function wn(e) {
|
|
|
1828
1849
|
const a = window.location.pathname + window.location.search + window.location.hash;
|
|
1829
1850
|
return i === a ? null : i;
|
|
1830
1851
|
}
|
|
1831
|
-
function
|
|
1852
|
+
function _n(e = "/") {
|
|
1832
1853
|
if (typeof window > "u")
|
|
1833
1854
|
return e;
|
|
1834
1855
|
const i = sessionStorage.getItem(ue);
|
|
1835
1856
|
return sessionStorage.removeItem(ue), i || e;
|
|
1836
1857
|
}
|
|
1837
1858
|
async function ce(e, i) {
|
|
1838
|
-
const a =
|
|
1859
|
+
const a = $e().config.appId;
|
|
1839
1860
|
if (!a) {
|
|
1840
1861
|
console.error(`${e} OAuth 失败: appId 未配置`);
|
|
1841
1862
|
return;
|
|
1842
1863
|
}
|
|
1843
|
-
|
|
1844
|
-
const
|
|
1864
|
+
wi();
|
|
1865
|
+
const s = qe(), l = (i == null ? void 0 : i.inviteCode) || hi() || void 0, d = {
|
|
1845
1866
|
appId: a,
|
|
1846
|
-
inviteCode:
|
|
1847
|
-
redirectUri:
|
|
1867
|
+
inviteCode: l,
|
|
1868
|
+
redirectUri: s,
|
|
1848
1869
|
acceptedTerms: (i == null ? void 0 : i.acceptedTerms) === !0 ? !0 : void 0
|
|
1849
|
-
},
|
|
1870
|
+
}, r = {
|
|
1850
1871
|
github: () => x().auth.oauth.github.login.get(d),
|
|
1851
1872
|
google: () => x().auth.oauth.google.login.get(d),
|
|
1852
1873
|
microsoft: () => x().auth.oauth.microsoft.login.get(d),
|
|
1853
1874
|
wechat: () => x().auth.oauth.wechat.login.get(d)
|
|
1854
1875
|
}, {
|
|
1855
1876
|
data: t,
|
|
1856
|
-
error:
|
|
1857
|
-
} = await
|
|
1858
|
-
if (!
|
|
1877
|
+
error: v
|
|
1878
|
+
} = await r[e]();
|
|
1879
|
+
if (!v) {
|
|
1859
1880
|
if (t != null && t.redirectUri) {
|
|
1860
1881
|
window.location.href = t.redirectUri;
|
|
1861
1882
|
return;
|
|
@@ -1863,30 +1884,30 @@ async function ce(e, i) {
|
|
|
1863
1884
|
console.error(`${e} OAuth 重定向URL为空`);
|
|
1864
1885
|
}
|
|
1865
1886
|
}
|
|
1866
|
-
function
|
|
1887
|
+
function bi(e) {
|
|
1867
1888
|
ce("github", e);
|
|
1868
1889
|
}
|
|
1869
|
-
function
|
|
1890
|
+
function _i(e) {
|
|
1870
1891
|
ce("google", e);
|
|
1871
1892
|
}
|
|
1872
|
-
function
|
|
1893
|
+
function ki(e) {
|
|
1873
1894
|
ce("microsoft", e);
|
|
1874
1895
|
}
|
|
1875
|
-
function
|
|
1896
|
+
function Ai(e) {
|
|
1876
1897
|
ce("wechat", e);
|
|
1877
1898
|
}
|
|
1878
|
-
function
|
|
1899
|
+
function zi() {
|
|
1879
1900
|
return {
|
|
1880
|
-
githubAuth:
|
|
1881
|
-
googleAuth:
|
|
1882
|
-
microsoftAuth:
|
|
1883
|
-
wechatAuth:
|
|
1901
|
+
githubAuth: bi,
|
|
1902
|
+
googleAuth: _i,
|
|
1903
|
+
microsoftAuth: ki,
|
|
1904
|
+
wechatAuth: Ai,
|
|
1884
1905
|
startOauth: ce,
|
|
1885
|
-
buildLoginOauthRedirectUri:
|
|
1886
|
-
buildBindOauthRedirectUri:
|
|
1906
|
+
buildLoginOauthRedirectUri: qe,
|
|
1907
|
+
buildBindOauthRedirectUri: gi
|
|
1887
1908
|
};
|
|
1888
1909
|
}
|
|
1889
|
-
const
|
|
1910
|
+
const Pi = ["src", "alt", "width", "height"], Ii = /* @__PURE__ */ J({
|
|
1890
1911
|
__name: "AuthProviderIcon",
|
|
1891
1912
|
props: {
|
|
1892
1913
|
icon: {},
|
|
@@ -1902,7 +1923,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
1902
1923
|
},
|
|
1903
1924
|
setup(e) {
|
|
1904
1925
|
const i = e;
|
|
1905
|
-
return (a,
|
|
1926
|
+
return (a, s) => n(nt)(i.icon) ? (y(), I(n(it), {
|
|
1906
1927
|
key: 0,
|
|
1907
1928
|
icon: i.icon,
|
|
1908
1929
|
width: i.size,
|
|
@@ -1915,32 +1936,32 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
1915
1936
|
width: i.size,
|
|
1916
1937
|
height: i.size,
|
|
1917
1938
|
class: Pe(["auth-provider-icon__image", i.class])
|
|
1918
|
-
}, null, 10,
|
|
1939
|
+
}, null, 10, Pi)) : C("", !0);
|
|
1919
1940
|
}
|
|
1920
|
-
}),
|
|
1941
|
+
}), Ci = /* @__PURE__ */ X(Ii, [["__scopeId", "data-v-1d09c1ef"]]), re = {
|
|
1921
1942
|
github: "selfhst:github",
|
|
1922
1943
|
google: "selfhst:google",
|
|
1923
1944
|
microsoft: "selfhst:microsoft",
|
|
1924
1945
|
wechat: "selfhst:wechat"
|
|
1925
|
-
}, Ei = "selfhst:ksuite-kpaste",
|
|
1946
|
+
}, Ei = "selfhst:ksuite-kpaste", Ri = 32, Si = 2, kn = Ri + Si * 2, An = 12, Vi = 24, pe = {
|
|
1926
1947
|
github: "GitHub",
|
|
1927
1948
|
google: "Google",
|
|
1928
1949
|
microsoft: "Microsoft",
|
|
1929
1950
|
wechat: "微信"
|
|
1930
|
-
}, Vi = {
|
|
1931
|
-
class: "oauth-binding-account"
|
|
1932
1951
|
}, $i = {
|
|
1952
|
+
class: "oauth-binding-account"
|
|
1953
|
+
}, Ti = {
|
|
1933
1954
|
key: 1,
|
|
1934
1955
|
class: "oauth-binding-account__icon"
|
|
1935
|
-
}, Ti = {
|
|
1936
|
-
class: "oauth-binding-account__info"
|
|
1937
1956
|
}, Ui = {
|
|
1938
|
-
class: "oauth-binding-
|
|
1957
|
+
class: "oauth-binding-account__info"
|
|
1939
1958
|
}, xi = {
|
|
1940
|
-
class: "oauth-binding-
|
|
1959
|
+
class: "oauth-binding-account__provider"
|
|
1941
1960
|
}, Oi = {
|
|
1961
|
+
class: "oauth-binding-account__name"
|
|
1962
|
+
}, Ni = {
|
|
1942
1963
|
class: "oauth-binding-verify-actions"
|
|
1943
|
-
},
|
|
1964
|
+
}, Di = /* @__PURE__ */ J({
|
|
1944
1965
|
__name: "AuthkitOAuthBinding",
|
|
1945
1966
|
props: {
|
|
1946
1967
|
provider: {
|
|
@@ -1959,23 +1980,23 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
1959
1980
|
setup(e) {
|
|
1960
1981
|
const {
|
|
1961
1982
|
config: i
|
|
1962
|
-
} =
|
|
1963
|
-
userProfile:
|
|
1964
|
-
fetchUserProfile:
|
|
1983
|
+
} = Ve(), a = e, {
|
|
1984
|
+
userProfile: s,
|
|
1985
|
+
fetchUserProfile: l
|
|
1965
1986
|
} = ne(), {
|
|
1966
1987
|
appsData: d
|
|
1967
|
-
} =
|
|
1968
|
-
buildBindOauthRedirectUri:
|
|
1969
|
-
} =
|
|
1988
|
+
} = Te(), {
|
|
1989
|
+
buildBindOauthRedirectUri: r
|
|
1990
|
+
} = zi(), t = A("hidden"), v = A(), g = A(!1);
|
|
1970
1991
|
let f;
|
|
1971
|
-
const
|
|
1992
|
+
const h = $(() => {
|
|
1972
1993
|
var c;
|
|
1973
|
-
return ((c =
|
|
1974
|
-
}),
|
|
1975
|
-
const c =
|
|
1994
|
+
return ((c = s.value) == null ? void 0 : c[a.provider]) || null;
|
|
1995
|
+
}), u = $(() => {
|
|
1996
|
+
const c = h.value;
|
|
1976
1997
|
return c ? c.login || c.name || c.nickname || c.displayName || c.userPrincipalName || c.email || c.mail || c.openid || a.label : "";
|
|
1977
1998
|
}), p = $(() => {
|
|
1978
|
-
const c =
|
|
1999
|
+
const c = h.value;
|
|
1979
2000
|
return (c == null ? void 0 : c.avatar_url) || (c == null ? void 0 : c.picture) || (c == null ? void 0 : c.headimgurl) || "";
|
|
1980
2001
|
}), S = $(() => re[a.provider]), R = $(() => {
|
|
1981
2002
|
const c = d.value.authMethods;
|
|
@@ -1985,38 +2006,38 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
1985
2006
|
return c.signUp.phone || c.login.phonePassword || c.login.phoneCode;
|
|
1986
2007
|
}), K = $(() => {
|
|
1987
2008
|
var c;
|
|
1988
|
-
return R.value && !!((c =
|
|
2009
|
+
return R.value && !!((c = s.value) != null && c.email);
|
|
1989
2010
|
}), j = $(() => {
|
|
1990
2011
|
var c;
|
|
1991
|
-
return B.value && !!((c =
|
|
2012
|
+
return B.value && !!((c = s.value) != null && c.phone);
|
|
1992
2013
|
}), V = $(() => {
|
|
1993
2014
|
const c = [];
|
|
1994
2015
|
return K.value && c.push("email"), j.value && c.push("phone"), c;
|
|
1995
|
-
}), w = $(() => R.value || B.value), q = $(() => t.value !== "hidden" && V.value.length > 1 && !
|
|
2016
|
+
}), w = $(() => R.value || B.value), q = $(() => t.value !== "hidden" && V.value.length > 1 && !v.value), _ = $(() => {
|
|
1996
2017
|
var c;
|
|
1997
|
-
return t.value !== "hidden" &&
|
|
2018
|
+
return t.value !== "hidden" && v.value === "email" && !!((c = s.value) != null && c.email);
|
|
1998
2019
|
}), P = $(() => {
|
|
1999
2020
|
var c;
|
|
2000
|
-
return t.value !== "hidden" &&
|
|
2021
|
+
return t.value !== "hidden" && v.value === "phone" && !!((c = s.value) != null && c.phone);
|
|
2001
2022
|
}), N = $(() => t.value === "unbind" ? "解绑" : "绑定");
|
|
2002
2023
|
function F(c) {
|
|
2003
2024
|
if (c === "hidden") {
|
|
2004
|
-
t.value = c,
|
|
2025
|
+
t.value = c, v.value = void 0;
|
|
2005
2026
|
return;
|
|
2006
2027
|
}
|
|
2007
2028
|
if (!w.value) {
|
|
2008
2029
|
c === "bind" && Z(), c === "unbind" && ae();
|
|
2009
2030
|
return;
|
|
2010
2031
|
}
|
|
2011
|
-
const
|
|
2012
|
-
if (
|
|
2032
|
+
const E = V.value;
|
|
2033
|
+
if (E.length === 0) {
|
|
2013
2034
|
G.error("请先绑定应用已开启的邮箱或手机号后再操作第三方账号");
|
|
2014
2035
|
return;
|
|
2015
2036
|
}
|
|
2016
|
-
t.value = c,
|
|
2037
|
+
t.value = c, v.value = E.length === 1 ? E[0] : void 0;
|
|
2017
2038
|
}
|
|
2018
2039
|
function D(c) {
|
|
2019
|
-
|
|
2040
|
+
v.value = c;
|
|
2020
2041
|
}
|
|
2021
2042
|
async function Z() {
|
|
2022
2043
|
const c = i.appId;
|
|
@@ -2024,32 +2045,32 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2024
2045
|
console.error(`${a.label} OAuth 失败: appId 未配置`);
|
|
2025
2046
|
return;
|
|
2026
2047
|
}
|
|
2027
|
-
const
|
|
2048
|
+
const E = r(), H = x().auth, oe = {
|
|
2028
2049
|
github: () => H.oauth.github.login.get({
|
|
2029
2050
|
appId: c,
|
|
2030
2051
|
mode: "bind",
|
|
2031
|
-
redirectUri:
|
|
2052
|
+
redirectUri: E
|
|
2032
2053
|
}),
|
|
2033
2054
|
google: () => H.oauth.google.login.get({
|
|
2034
2055
|
appId: c,
|
|
2035
2056
|
mode: "bind",
|
|
2036
|
-
redirectUri:
|
|
2057
|
+
redirectUri: E
|
|
2037
2058
|
}),
|
|
2038
2059
|
microsoft: () => H.oauth.microsoft.login.get({
|
|
2039
2060
|
appId: c,
|
|
2040
2061
|
mode: "bind",
|
|
2041
|
-
redirectUri:
|
|
2062
|
+
redirectUri: E
|
|
2042
2063
|
}),
|
|
2043
2064
|
wechat: () => H.oauth.wechat.login.get({
|
|
2044
2065
|
appId: c,
|
|
2045
2066
|
mode: "bind",
|
|
2046
|
-
redirectUri:
|
|
2067
|
+
redirectUri: E
|
|
2047
2068
|
})
|
|
2048
2069
|
}, {
|
|
2049
2070
|
data: te,
|
|
2050
|
-
error:
|
|
2071
|
+
error: Le
|
|
2051
2072
|
} = await oe[a.provider]();
|
|
2052
|
-
|
|
2073
|
+
Le || !(te != null && te.redirectUri) || (g.value = !0, window.open(te.redirectUri, "_blank"));
|
|
2053
2074
|
}
|
|
2054
2075
|
async function ae() {
|
|
2055
2076
|
const {
|
|
@@ -2057,106 +2078,106 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2057
2078
|
} = await x().auth.users.unbind.oauth.post({
|
|
2058
2079
|
provider: a.provider
|
|
2059
2080
|
});
|
|
2060
|
-
c || (G.success("解绑成功"), t.value = "hidden",
|
|
2081
|
+
c || (G.success("解绑成功"), t.value = "hidden", l());
|
|
2061
2082
|
}
|
|
2062
2083
|
function O() {
|
|
2063
2084
|
t.value === "bind" && (t.value = "hidden", Z()), t.value === "unbind" && ae();
|
|
2064
2085
|
}
|
|
2065
2086
|
function b() {
|
|
2066
|
-
g.value &&
|
|
2087
|
+
g.value && l();
|
|
2067
2088
|
}
|
|
2068
2089
|
return de(() => {
|
|
2069
|
-
|
|
2090
|
+
s.value || l(), f = setInterval(b, 1e3);
|
|
2070
2091
|
}), Ae(() => {
|
|
2071
2092
|
f && clearInterval(f);
|
|
2072
|
-
}), (c,
|
|
2093
|
+
}), (c, E) => {
|
|
2073
2094
|
var H, oe;
|
|
2074
|
-
return y(), M(ie, null, [!
|
|
2095
|
+
return y(), M(ie, null, [!h.value && t.value === "hidden" ? (y(), I(n(Y), {
|
|
2075
2096
|
key: 0,
|
|
2076
2097
|
title: `绑定${a.label}`
|
|
2077
2098
|
}, {
|
|
2078
2099
|
action: o(() => [m(n(T), {
|
|
2079
2100
|
size: a.size,
|
|
2080
2101
|
type: "primary",
|
|
2081
|
-
onClick:
|
|
2102
|
+
onClick: E[0] || (E[0] = (te) => F("bind"))
|
|
2082
2103
|
}, {
|
|
2083
2104
|
default: o(() => [k(" 绑定" + U(a.label), 1)]),
|
|
2084
2105
|
_: 1
|
|
2085
2106
|
}, 8, ["size"])]),
|
|
2086
2107
|
default: o(() => [k(" 您还未绑定" + U(a.label) + "账号,请点击绑定。 ", 1)]),
|
|
2087
2108
|
_: 1
|
|
2088
|
-
}, 8, ["title"])) :
|
|
2109
|
+
}, 8, ["title"])) : C("", !0), h.value && t.value === "hidden" ? (y(), I(n(Y), {
|
|
2089
2110
|
key: 1,
|
|
2090
2111
|
title: `解绑${a.label}`
|
|
2091
2112
|
}, {
|
|
2092
2113
|
action: o(() => [m(n(T), {
|
|
2093
2114
|
size: a.size,
|
|
2094
2115
|
type: "primary",
|
|
2095
|
-
onClick:
|
|
2116
|
+
onClick: E[1] || (E[1] = (te) => F("unbind"))
|
|
2096
2117
|
}, {
|
|
2097
2118
|
default: o(() => [k(" 解绑" + U(a.label), 1)]),
|
|
2098
2119
|
_: 1
|
|
2099
2120
|
}, 8, ["size"])]),
|
|
2100
|
-
default: o(() => [z("div",
|
|
2121
|
+
default: o(() => [z("div", $i, [p.value ? (y(), I(n(Ee), {
|
|
2101
2122
|
key: 0,
|
|
2102
2123
|
class: "oauth-binding-account__avatar",
|
|
2103
2124
|
"image-url": p.value,
|
|
2104
2125
|
size: 42
|
|
2105
|
-
}, null, 8, ["image-url"])) : (y(), M("div",
|
|
2126
|
+
}, null, 8, ["image-url"])) : (y(), M("div", Ti, [m(Ci, {
|
|
2106
2127
|
icon: S.value,
|
|
2107
|
-
size: n(
|
|
2128
|
+
size: n(Vi),
|
|
2108
2129
|
alt: a.label
|
|
2109
|
-
}, null, 8, ["icon", "size", "alt"])])), z("div",
|
|
2130
|
+
}, null, 8, ["icon", "size", "alt"])])), z("div", Ui, [z("div", xi, U(a.label), 1), z("div", Oi, U(u.value), 1)])])]),
|
|
2110
2131
|
_: 1
|
|
2111
|
-
}, 8, ["title"])) :
|
|
2132
|
+
}, 8, ["title"])) : C("", !0), q.value ? (y(), I(n(Y), {
|
|
2112
2133
|
key: 2,
|
|
2113
2134
|
title: `${N.value}前验证身份`
|
|
2114
2135
|
}, {
|
|
2115
|
-
action: o(() => [z("div",
|
|
2136
|
+
action: o(() => [z("div", Ni, [K.value ? (y(), I(n(T), {
|
|
2116
2137
|
key: 0,
|
|
2117
2138
|
size: a.size,
|
|
2118
2139
|
type: "primary",
|
|
2119
|
-
onClick:
|
|
2140
|
+
onClick: E[2] || (E[2] = (te) => D("email"))
|
|
2120
2141
|
}, {
|
|
2121
|
-
default: o(() => [...
|
|
2142
|
+
default: o(() => [...E[4] || (E[4] = [k(" 邮箱验证 ", -1)])]),
|
|
2122
2143
|
_: 1
|
|
2123
|
-
}, 8, ["size"])) :
|
|
2144
|
+
}, 8, ["size"])) : C("", !0), j.value ? (y(), I(n(T), {
|
|
2124
2145
|
key: 1,
|
|
2125
2146
|
size: a.size,
|
|
2126
2147
|
type: "primary",
|
|
2127
|
-
onClick:
|
|
2148
|
+
onClick: E[3] || (E[3] = (te) => D("phone"))
|
|
2128
2149
|
}, {
|
|
2129
|
-
default: o(() => [...
|
|
2150
|
+
default: o(() => [...E[5] || (E[5] = [k(" 手机验证 ", -1)])]),
|
|
2130
2151
|
_: 1
|
|
2131
|
-
}, 8, ["size"])) :
|
|
2132
|
-
default: o(() => [
|
|
2152
|
+
}, 8, ["size"])) : C("", !0)])]),
|
|
2153
|
+
default: o(() => [E[6] || (E[6] = k(" 请选择一种已绑定的验证方式。 ", -1))]),
|
|
2133
2154
|
_: 1
|
|
2134
|
-
}, 8, ["title"])) :
|
|
2155
|
+
}, 8, ["title"])) : C("", !0), _.value ? (y(), I(ge, {
|
|
2135
2156
|
key: 3,
|
|
2136
2157
|
size: a.size,
|
|
2137
|
-
email: (H = n(
|
|
2158
|
+
email: (H = n(s)) == null ? void 0 : H.email,
|
|
2138
2159
|
onNext: O
|
|
2139
|
-
}, null, 8, ["size", "email"])) :
|
|
2160
|
+
}, null, 8, ["size", "email"])) : C("", !0), P.value ? (y(), I(we, {
|
|
2140
2161
|
key: 4,
|
|
2141
2162
|
size: a.size,
|
|
2142
|
-
phone: ((oe = n(
|
|
2163
|
+
phone: ((oe = n(s)) == null ? void 0 : oe.phone) || "",
|
|
2143
2164
|
onNext: O
|
|
2144
|
-
}, null, 8, ["size", "phone"])) :
|
|
2165
|
+
}, null, 8, ["size", "phone"])) : C("", !0)], 64);
|
|
2145
2166
|
};
|
|
2146
2167
|
}
|
|
2147
|
-
}),
|
|
2168
|
+
}), Bi = /* @__PURE__ */ X(Di, [["__scopeId", "data-v-6b13b949"]]), qi = {
|
|
2148
2169
|
class: "dependency-list"
|
|
2149
|
-
}, qi = {
|
|
2150
|
-
class: "label"
|
|
2151
2170
|
}, Li = {
|
|
2152
|
-
class: "
|
|
2171
|
+
class: "label"
|
|
2153
2172
|
}, Mi = {
|
|
2154
|
-
class: "
|
|
2173
|
+
class: "count"
|
|
2155
2174
|
}, Ki = {
|
|
2156
|
-
class: "
|
|
2175
|
+
class: "action-bar"
|
|
2157
2176
|
}, Fi = {
|
|
2158
2177
|
class: "verify-code-row"
|
|
2159
|
-
}, Hi =
|
|
2178
|
+
}, Hi = {
|
|
2179
|
+
class: "verify-code-row"
|
|
2180
|
+
}, Wi = /* @__PURE__ */ J({
|
|
2160
2181
|
__name: "AuthkitAccountDelete",
|
|
2161
2182
|
props: {
|
|
2162
2183
|
size: {
|
|
@@ -2168,22 +2189,22 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2168
2189
|
setup(e, {
|
|
2169
2190
|
emit: i
|
|
2170
2191
|
}) {
|
|
2171
|
-
const a = e,
|
|
2172
|
-
userProfile:
|
|
2192
|
+
const a = e, s = i, {
|
|
2193
|
+
userProfile: l,
|
|
2173
2194
|
clearUserProfile: d
|
|
2174
2195
|
} = ne(), {
|
|
2175
|
-
clearAuth:
|
|
2176
|
-
} =
|
|
2196
|
+
clearAuth: r
|
|
2197
|
+
} = ot(), t = A("check"), v = A(!1), g = A([]), f = A(!1), h = A(""), u = A(0);
|
|
2177
2198
|
let p = null;
|
|
2178
2199
|
const S = A("email"), R = $(() => {
|
|
2179
|
-
var
|
|
2180
|
-
const O = ((
|
|
2200
|
+
var E;
|
|
2201
|
+
const O = ((E = l.value) == null ? void 0 : E.email) || "";
|
|
2181
2202
|
if (!O) return "";
|
|
2182
2203
|
const [b, c] = O.split("@");
|
|
2183
2204
|
return b.length <= 2 ? O : `${b.slice(0, 2)}***@${c}`;
|
|
2184
2205
|
}), B = $(() => {
|
|
2185
2206
|
var b;
|
|
2186
|
-
const O = ((b =
|
|
2207
|
+
const O = ((b = l.value) == null ? void 0 : b.phone) || "";
|
|
2187
2208
|
return O.length < 7 ? O : `${O.slice(0, 3)}****${O.slice(-4)}`;
|
|
2188
2209
|
}), K = $(() => S.value === "email" ? `为确保账号安全,我们将向您的邮箱 ${R.value} 发送验证码` : `为确保账号安全,我们将向您的手机号 ${B.value} 发送验证码`), j = $(() => S.value === "email" ? `验证码已发送至 ${R.value},注销后该账号将无法继续登录,请谨慎操作` : `验证码已发送至 ${B.value},注销后该账号将无法继续登录,请谨慎操作`), V = A(), w = A({
|
|
2189
2210
|
userToken: "",
|
|
@@ -2196,43 +2217,43 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2196
2217
|
}
|
|
2197
2218
|
async function P() {
|
|
2198
2219
|
var O, b;
|
|
2199
|
-
if (
|
|
2220
|
+
if (v.value = !0, v.value = !1, !((O = l.value) != null && O.email) && !((b = l.value) != null && b.phone)) {
|
|
2200
2221
|
G.error("请先绑定邮箱或手机号后再注销账号");
|
|
2201
2222
|
return;
|
|
2202
2223
|
}
|
|
2203
|
-
if (
|
|
2224
|
+
if (l.value.email && l.value.phone) {
|
|
2204
2225
|
t.value = "chooseMethod";
|
|
2205
2226
|
return;
|
|
2206
2227
|
}
|
|
2207
|
-
S.value =
|
|
2228
|
+
S.value = l.value.email ? "email" : "phone", t.value = "sendCode";
|
|
2208
2229
|
}
|
|
2209
2230
|
function N(O) {
|
|
2210
2231
|
S.value = O, t.value = "sendCode";
|
|
2211
2232
|
}
|
|
2212
2233
|
async function F() {
|
|
2213
|
-
var c,
|
|
2234
|
+
var c, E;
|
|
2214
2235
|
if (S.value === "email") {
|
|
2215
|
-
if (!((c =
|
|
2236
|
+
if (!((c = l.value) != null && c.email)) {
|
|
2216
2237
|
G.error("请先绑定邮箱");
|
|
2217
2238
|
return;
|
|
2218
2239
|
}
|
|
2219
2240
|
f.value = !0;
|
|
2220
2241
|
const H = await x().auth.verify.email.retry.post({
|
|
2221
|
-
email:
|
|
2242
|
+
email: l.value.email,
|
|
2222
2243
|
purpose: "deleteAccount"
|
|
2223
2244
|
});
|
|
2224
2245
|
f.value = !1;
|
|
2225
2246
|
const oe = ke(H);
|
|
2226
|
-
H.data && (
|
|
2247
|
+
H.data && (h.value = H.data.emailVerifyId, G.success("验证码已发送"), t.value = "confirm"), D(oe);
|
|
2227
2248
|
return;
|
|
2228
2249
|
}
|
|
2229
|
-
if (!((
|
|
2250
|
+
if (!((E = l.value) != null && E.phone)) {
|
|
2230
2251
|
G.error("请先绑定手机号");
|
|
2231
2252
|
return;
|
|
2232
2253
|
}
|
|
2233
2254
|
f.value = !0;
|
|
2234
2255
|
const O = await x().auth.verify.sms.send.post({
|
|
2235
|
-
phone:
|
|
2256
|
+
phone: l.value.phone,
|
|
2236
2257
|
purpose: "deleteAccount"
|
|
2237
2258
|
});
|
|
2238
2259
|
f.value = !1;
|
|
@@ -2240,33 +2261,33 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2240
2261
|
O.error || (G.success("验证码已发送"), t.value = "confirm"), D(b);
|
|
2241
2262
|
}
|
|
2242
2263
|
function D(O) {
|
|
2243
|
-
!O || O <= 0 || (
|
|
2244
|
-
|
|
2264
|
+
!O || O <= 0 || (u.value = Math.ceil(O), p && clearInterval(p), p = setInterval(() => {
|
|
2265
|
+
u.value--, u.value <= 0 && p && (clearInterval(p), p = null);
|
|
2245
2266
|
}, 1e3));
|
|
2246
2267
|
}
|
|
2247
2268
|
Ae(() => {
|
|
2248
2269
|
p && (clearInterval(p), p = null);
|
|
2249
2270
|
});
|
|
2250
2271
|
async function Z() {
|
|
2251
|
-
var
|
|
2252
|
-
if (await ((
|
|
2272
|
+
var E, H;
|
|
2273
|
+
if (await ((E = V.value) == null ? void 0 : E.validate())) return;
|
|
2253
2274
|
q.value = !0;
|
|
2254
2275
|
const b = S.value === "email" ? {
|
|
2255
2276
|
method: "email",
|
|
2256
2277
|
userToken: w.value.userToken,
|
|
2257
|
-
emailVerifyId:
|
|
2278
|
+
emailVerifyId: h.value,
|
|
2258
2279
|
password: w.value.password || void 0,
|
|
2259
2280
|
confirmText: w.value.confirmText
|
|
2260
2281
|
} : {
|
|
2261
2282
|
method: "phone",
|
|
2262
|
-
phone: (H =
|
|
2283
|
+
phone: (H = l.value) == null ? void 0 : H.phone,
|
|
2263
2284
|
code: w.value.code,
|
|
2264
2285
|
password: w.value.password || void 0,
|
|
2265
2286
|
confirmText: w.value.confirmText
|
|
2266
2287
|
}, {
|
|
2267
2288
|
error: c
|
|
2268
2289
|
} = await x().auth.users.deleteAccount.post(b);
|
|
2269
|
-
q.value = !1, c || (t.value = "success", d(),
|
|
2290
|
+
q.value = !1, c || (t.value = "success", d(), r(), s("deleted"));
|
|
2270
2291
|
}
|
|
2271
2292
|
function ae() {
|
|
2272
2293
|
window.location.href = "/";
|
|
@@ -2280,10 +2301,10 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2280
2301
|
size: a.size,
|
|
2281
2302
|
type: "primary",
|
|
2282
2303
|
status: "danger",
|
|
2283
|
-
loading:
|
|
2304
|
+
loading: v.value,
|
|
2284
2305
|
onClick: P
|
|
2285
2306
|
}, {
|
|
2286
|
-
default: o(() => [k(U(
|
|
2307
|
+
default: o(() => [k(U(v.value ? "检查中..." : "开始注销"), 1)]),
|
|
2287
2308
|
_: 1
|
|
2288
2309
|
}, 8, ["size", "loading"])]),
|
|
2289
2310
|
default: o(() => [b[10] || (b[10] = k(" 注销账号后,登录凭据、第三方绑定和当前登录态会被清除;历史订单、用量、审计等业务记录会保留用于对账和安全追溯。 ", -1))]),
|
|
@@ -2296,10 +2317,10 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2296
2317
|
}, {
|
|
2297
2318
|
default: o(() => [...b[11] || (b[11] = [k(" 您的账号下还有以下资源,请先处理后再注销: ", -1)])]),
|
|
2298
2319
|
_: 1
|
|
2299
|
-
}), z("div",
|
|
2320
|
+
}), z("div", qi, [(y(!0), M(ie, null, We(g.value, (c) => (y(), M("div", {
|
|
2300
2321
|
key: c.type,
|
|
2301
2322
|
class: "dependency-item"
|
|
2302
|
-
}, [z("span",
|
|
2323
|
+
}, [z("span", Li, U(c.label), 1), z("span", Mi, U(c.count) + " 个", 1)]))), 128))]), z("div", Ki, [m(n(T), {
|
|
2303
2324
|
size: a.size,
|
|
2304
2325
|
onClick: b[0] || (b[0] = (c) => t.value = "check")
|
|
2305
2326
|
}, {
|
|
@@ -2312,14 +2333,14 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2312
2333
|
}, {
|
|
2313
2334
|
action: o(() => [m(n(me), null, {
|
|
2314
2335
|
default: o(() => {
|
|
2315
|
-
var c,
|
|
2336
|
+
var c, E;
|
|
2316
2337
|
return [m(n(T), {
|
|
2317
2338
|
size: a.size,
|
|
2318
2339
|
onClick: b[1] || (b[1] = (H) => t.value = "check")
|
|
2319
2340
|
}, {
|
|
2320
2341
|
default: o(() => [...b[13] || (b[13] = [k("取消", -1)])]),
|
|
2321
2342
|
_: 1
|
|
2322
|
-
}, 8, ["size"]), (c = n(
|
|
2343
|
+
}, 8, ["size"]), (c = n(l)) != null && c.email ? (y(), I(n(T), {
|
|
2323
2344
|
key: 0,
|
|
2324
2345
|
size: a.size,
|
|
2325
2346
|
type: "primary",
|
|
@@ -2327,7 +2348,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2327
2348
|
}, {
|
|
2328
2349
|
default: o(() => [...b[14] || (b[14] = [k(" 邮箱验证 ", -1)])]),
|
|
2329
2350
|
_: 1
|
|
2330
|
-
}, 8, ["size"])) :
|
|
2351
|
+
}, 8, ["size"])) : C("", !0), (E = n(l)) != null && E.phone ? (y(), I(n(T), {
|
|
2331
2352
|
key: 1,
|
|
2332
2353
|
size: a.size,
|
|
2333
2354
|
type: "primary",
|
|
@@ -2335,7 +2356,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2335
2356
|
}, {
|
|
2336
2357
|
default: o(() => [...b[15] || (b[15] = [k(" 手机验证 ", -1)])]),
|
|
2337
2358
|
_: 1
|
|
2338
|
-
}, 8, ["size"])) :
|
|
2359
|
+
}, 8, ["size"])) : C("", !0)];
|
|
2339
2360
|
}),
|
|
2340
2361
|
_: 1
|
|
2341
2362
|
})]),
|
|
@@ -2393,18 +2414,18 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2393
2414
|
message: "请输入验证码"
|
|
2394
2415
|
}]
|
|
2395
2416
|
}, {
|
|
2396
|
-
default: o(() => [z("div",
|
|
2417
|
+
default: o(() => [z("div", Fi, [m(n(Q), {
|
|
2397
2418
|
modelValue: w.value.userToken,
|
|
2398
|
-
"onUpdate:modelValue": b[5] || (b[5] = (
|
|
2419
|
+
"onUpdate:modelValue": b[5] || (b[5] = (E) => w.value.userToken = E),
|
|
2399
2420
|
placeholder: "请输入6位验证码",
|
|
2400
2421
|
"max-length": 6,
|
|
2401
2422
|
"allow-clear": ""
|
|
2402
2423
|
}, null, 8, ["modelValue"]), m(n(T), {
|
|
2403
|
-
disabled:
|
|
2424
|
+
disabled: u.value > 0,
|
|
2404
2425
|
loading: f.value,
|
|
2405
2426
|
onClick: F
|
|
2406
2427
|
}, {
|
|
2407
|
-
default: o(() => [k(U(
|
|
2428
|
+
default: o(() => [k(U(u.value > 0 ? `${u.value}s 后重发` : "重新发送"), 1)]),
|
|
2408
2429
|
_: 1
|
|
2409
2430
|
}, 8, ["disabled", "loading"])])]),
|
|
2410
2431
|
_: 1
|
|
@@ -2417,21 +2438,21 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2417
2438
|
message: "请输入验证码"
|
|
2418
2439
|
}]
|
|
2419
2440
|
}, {
|
|
2420
|
-
default: o(() => [z("div",
|
|
2441
|
+
default: o(() => [z("div", Hi, [m(n(Q), {
|
|
2421
2442
|
modelValue: w.value.code,
|
|
2422
|
-
"onUpdate:modelValue": b[6] || (b[6] = (
|
|
2443
|
+
"onUpdate:modelValue": b[6] || (b[6] = (E) => w.value.code = E),
|
|
2423
2444
|
placeholder: "请输入验证码",
|
|
2424
2445
|
"allow-clear": ""
|
|
2425
2446
|
}, null, 8, ["modelValue"]), m(n(T), {
|
|
2426
|
-
disabled:
|
|
2447
|
+
disabled: u.value > 0,
|
|
2427
2448
|
loading: f.value,
|
|
2428
2449
|
onClick: F
|
|
2429
2450
|
}, {
|
|
2430
|
-
default: o(() => [k(U(
|
|
2451
|
+
default: o(() => [k(U(u.value > 0 ? `${u.value}s 后重发` : "重新发送"), 1)]),
|
|
2431
2452
|
_: 1
|
|
2432
2453
|
}, 8, ["disabled", "loading"])])]),
|
|
2433
2454
|
_: 1
|
|
2434
|
-
})), (c = n(
|
|
2455
|
+
})), (c = n(l)) != null && c.hasPassword ? (y(), I(n(L), {
|
|
2435
2456
|
key: 2,
|
|
2436
2457
|
field: "password",
|
|
2437
2458
|
label: "登录密码",
|
|
@@ -2440,14 +2461,14 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2440
2461
|
message: "请输入密码"
|
|
2441
2462
|
}]
|
|
2442
2463
|
}, {
|
|
2443
|
-
default: o(() => [m(n(
|
|
2464
|
+
default: o(() => [m(n(Je), {
|
|
2444
2465
|
modelValue: w.value.password,
|
|
2445
|
-
"onUpdate:modelValue": b[7] || (b[7] = (
|
|
2466
|
+
"onUpdate:modelValue": b[7] || (b[7] = (E) => w.value.password = E),
|
|
2446
2467
|
placeholder: "请输入您的登录密码",
|
|
2447
2468
|
"allow-clear": ""
|
|
2448
2469
|
}, null, 8, ["modelValue"])]),
|
|
2449
2470
|
_: 1
|
|
2450
|
-
})) :
|
|
2471
|
+
})) : C("", !0), m(n(L), {
|
|
2451
2472
|
field: "confirmText",
|
|
2452
2473
|
label: "请输入「注销」以确认",
|
|
2453
2474
|
rules: [{
|
|
@@ -2459,7 +2480,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2459
2480
|
}, {
|
|
2460
2481
|
default: o(() => [m(n(Q), {
|
|
2461
2482
|
modelValue: w.value.confirmText,
|
|
2462
|
-
"onUpdate:modelValue": b[8] || (b[8] = (
|
|
2483
|
+
"onUpdate:modelValue": b[8] || (b[8] = (E) => w.value.confirmText = E),
|
|
2463
2484
|
placeholder: "注销",
|
|
2464
2485
|
"allow-clear": ""
|
|
2465
2486
|
}, null, 8, ["modelValue"])]),
|
|
@@ -2467,7 +2488,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2467
2488
|
}, 8, ["rules"]), m(n(L), null, {
|
|
2468
2489
|
default: o(() => [m(n(me), null, {
|
|
2469
2490
|
default: o(() => [m(n(T), {
|
|
2470
|
-
onClick: b[9] || (b[9] = (
|
|
2491
|
+
onClick: b[9] || (b[9] = (E) => t.value = "check")
|
|
2471
2492
|
}, {
|
|
2472
2493
|
default: o(() => [...b[18] || (b[18] = [k("取消", -1)])]),
|
|
2473
2494
|
_: 1
|
|
@@ -2486,7 +2507,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2486
2507
|
})];
|
|
2487
2508
|
}),
|
|
2488
2509
|
_: 1
|
|
2489
|
-
}, 8, ["model", "size"])], 64)) : t.value === "success" ? (y(), I(n(
|
|
2510
|
+
}, 8, ["model", "size"])], 64)) : t.value === "success" ? (y(), I(n(je), {
|
|
2490
2511
|
key: 5,
|
|
2491
2512
|
status: "success",
|
|
2492
2513
|
title: "账号已注销"
|
|
@@ -2500,29 +2521,29 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2500
2521
|
_: 1
|
|
2501
2522
|
})]),
|
|
2502
2523
|
_: 1
|
|
2503
|
-
})) :
|
|
2524
|
+
})) : C("", !0);
|
|
2504
2525
|
}
|
|
2505
|
-
}),
|
|
2526
|
+
}), Gi = /* @__PURE__ */ X(Wi, [["__scopeId", "data-v-90439767"]]), Yi = {
|
|
2506
2527
|
class: "content"
|
|
2507
|
-
}, Yi = {
|
|
2508
|
-
class: "left"
|
|
2509
2528
|
}, Ji = {
|
|
2529
|
+
class: "left"
|
|
2530
|
+
}, ji = {
|
|
2510
2531
|
class: "right"
|
|
2511
|
-
},
|
|
2532
|
+
}, Qi = /* @__PURE__ */ J({
|
|
2512
2533
|
__name: "AuthkitAppSetting",
|
|
2513
2534
|
emits: ["confirm", "cancel"],
|
|
2514
2535
|
setup(e, {
|
|
2515
2536
|
expose: i,
|
|
2516
2537
|
emit: a
|
|
2517
2538
|
}) {
|
|
2518
|
-
const
|
|
2519
|
-
function
|
|
2520
|
-
w.value = !1, t.value = ["PersonalInformation"],
|
|
2539
|
+
const s = a;
|
|
2540
|
+
function l() {
|
|
2541
|
+
w.value = !1, t.value = ["PersonalInformation"], s("cancel");
|
|
2521
2542
|
}
|
|
2522
2543
|
function d() {
|
|
2523
|
-
|
|
2544
|
+
l();
|
|
2524
2545
|
}
|
|
2525
|
-
const
|
|
2546
|
+
const r = A("large"), t = A(["PersonalInformation"]), v = [{
|
|
2526
2547
|
provider: "github",
|
|
2527
2548
|
name: pe.github,
|
|
2528
2549
|
meta: {
|
|
@@ -2548,16 +2569,16 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2548
2569
|
}
|
|
2549
2570
|
}], {
|
|
2550
2571
|
appsData: g
|
|
2551
|
-
} =
|
|
2572
|
+
} = Te(), f = $(() => {
|
|
2552
2573
|
const _ = g.value.authMethods;
|
|
2553
2574
|
return _.signUp.email || _.login.emailPassword || _.login.emailCode;
|
|
2554
|
-
}),
|
|
2575
|
+
}), h = $(() => {
|
|
2555
2576
|
const _ = g.value.authMethods;
|
|
2556
2577
|
return _.signUp.phone || _.login.phonePassword || _.login.phoneCode;
|
|
2557
|
-
}),
|
|
2578
|
+
}), u = $(() => {
|
|
2558
2579
|
const _ = g.value.authMethods;
|
|
2559
2580
|
return _.login.emailPassword || _.login.phonePassword;
|
|
2560
|
-
}), p = $(() =>
|
|
2581
|
+
}), p = $(() => u.value || f.value || h.value), S = $(() => g.value.authMethods.login.passkey), R = $(() => v.filter((_) => {
|
|
2561
2582
|
var P, N;
|
|
2562
2583
|
return (N = (P = g.value.oauth) == null ? void 0 : P[_.provider]) == null ? void 0 : N.enabled;
|
|
2563
2584
|
}).map((_) => ({
|
|
@@ -2571,7 +2592,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2571
2592
|
meta: {
|
|
2572
2593
|
icon: "ic:baseline-email"
|
|
2573
2594
|
}
|
|
2574
|
-
}),
|
|
2595
|
+
}), h.value && _.push({
|
|
2575
2596
|
name: "手机号",
|
|
2576
2597
|
path: "PhoneBinding",
|
|
2577
2598
|
meta: {
|
|
@@ -2627,7 +2648,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2627
2648
|
const {
|
|
2628
2649
|
changeType: V,
|
|
2629
2650
|
show: w
|
|
2630
|
-
} =
|
|
2651
|
+
} = st(s);
|
|
2631
2652
|
Ie(R, (_) => {
|
|
2632
2653
|
t.value[0].startsWith("OAuthBinding:") && !_.some((P) => P.path === t.value[0]) && (t.value = ["PersonalInformation"]);
|
|
2633
2654
|
}), Ie(B, (_) => {
|
|
@@ -2642,78 +2663,78 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2642
2663
|
}
|
|
2643
2664
|
return i({
|
|
2644
2665
|
setData: q
|
|
2645
|
-
}), (_, P) => n(w) ? (y(), I(n(
|
|
2666
|
+
}), (_, P) => n(w) ? (y(), I(n(Qe), {
|
|
2646
2667
|
key: 0,
|
|
2647
2668
|
visible: !0,
|
|
2648
2669
|
"body-class": "AppSettingbodyClass",
|
|
2649
2670
|
"mask-closable": !1,
|
|
2650
2671
|
footer: !1,
|
|
2651
|
-
width: n(
|
|
2652
|
-
onCancel:
|
|
2672
|
+
width: n(Me),
|
|
2673
|
+
onCancel: l
|
|
2653
2674
|
}, {
|
|
2654
2675
|
title: o(() => [...P[1] || (P[1] = [k(" 用户信息 ", -1)])]),
|
|
2655
|
-
default: o(() => [z("div",
|
|
2676
|
+
default: o(() => [z("div", Yi, [z("div", Ji, [m(at, {
|
|
2656
2677
|
"selected-keys": t.value,
|
|
2657
2678
|
"onUpdate:selectedKeys": P[0] || (P[0] = (N) => t.value = N),
|
|
2658
2679
|
menus: B.value,
|
|
2659
2680
|
onChange: j
|
|
2660
|
-
}, null, 8, ["selected-keys", "menus"])]), z("div",
|
|
2681
|
+
}, null, 8, ["selected-keys", "menus"])]), z("div", ji, [t.value[0] === "PersonalInformation" ? (y(), I(kt, {
|
|
2661
2682
|
key: 0,
|
|
2662
|
-
size:
|
|
2663
|
-
}, null, 8, ["size"])) :
|
|
2683
|
+
size: r.value
|
|
2684
|
+
}, null, 8, ["size"])) : C("", !0), t.value[0] === "EmailBinding" ? (y(), I(ai, {
|
|
2664
2685
|
key: 1,
|
|
2665
|
-
size:
|
|
2666
|
-
}, null, 8, ["size"])) :
|
|
2686
|
+
size: r.value
|
|
2687
|
+
}, null, 8, ["size"])) : C("", !0), t.value[0] === "PhoneBinding" ? (y(), I(vi, {
|
|
2667
2688
|
key: 2,
|
|
2668
|
-
size:
|
|
2669
|
-
}, null, 8, ["size"])) :
|
|
2689
|
+
size: r.value
|
|
2690
|
+
}, null, 8, ["size"])) : C("", !0), t.value[0] === "SetPassword" ? (y(), I(Ut, {
|
|
2670
2691
|
key: 3,
|
|
2671
|
-
size:
|
|
2672
|
-
}, null, 8, ["size"])) :
|
|
2692
|
+
size: r.value
|
|
2693
|
+
}, null, 8, ["size"])) : C("", !0), t.value[0] === "PasskeyBinding" ? (y(), I(jt, {
|
|
2673
2694
|
key: 4,
|
|
2674
|
-
size:
|
|
2675
|
-
}, null, 8, ["size"])) :
|
|
2695
|
+
size: r.value
|
|
2696
|
+
}, null, 8, ["size"])) : C("", !0), K.value ? (y(), I(Bi, {
|
|
2676
2697
|
key: K.value.provider,
|
|
2677
2698
|
provider: K.value.provider,
|
|
2678
2699
|
label: K.value.name,
|
|
2679
|
-
size:
|
|
2680
|
-
}, null, 8, ["provider", "label", "size"])) :
|
|
2700
|
+
size: r.value
|
|
2701
|
+
}, null, 8, ["provider", "label", "size"])) : C("", !0), t.value[0] === "AccountDelete" ? (y(), I(Gi, {
|
|
2681
2702
|
key: 6,
|
|
2682
|
-
size:
|
|
2703
|
+
size: r.value,
|
|
2683
2704
|
onDeleted: d
|
|
2684
|
-
}, null, 8, ["size"])) :
|
|
2705
|
+
}, null, 8, ["size"])) : C("", !0)])])]),
|
|
2685
2706
|
_: 1
|
|
2686
|
-
}, 8, ["width"])) :
|
|
2707
|
+
}, 8, ["width"])) : C("", !0);
|
|
2687
2708
|
}
|
|
2688
|
-
}),
|
|
2709
|
+
}), zn = /* @__PURE__ */ X(Qi, [["__scopeId", "data-v-ff81539f"]]);
|
|
2689
2710
|
export {
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2711
|
+
zn as A,
|
|
2712
|
+
ni as B,
|
|
2713
|
+
Bi as O,
|
|
2714
|
+
jt as P,
|
|
2694
2715
|
he as S,
|
|
2695
|
-
|
|
2696
|
-
|
|
2716
|
+
ai as _,
|
|
2717
|
+
mi as a,
|
|
2697
2718
|
ge as b,
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2719
|
+
Tt as c,
|
|
2720
|
+
kt as d,
|
|
2721
|
+
vi as e,
|
|
2701
2722
|
we as f,
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2723
|
+
Ut as g,
|
|
2724
|
+
_n as h,
|
|
2725
|
+
zi as i,
|
|
2726
|
+
Si as j,
|
|
2727
|
+
kn as k,
|
|
2728
|
+
Ci as l,
|
|
2729
|
+
An as m,
|
|
2709
2730
|
re as n,
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2731
|
+
Ri as o,
|
|
2732
|
+
ye as p,
|
|
2733
|
+
se as q,
|
|
2734
|
+
hi as r,
|
|
2735
|
+
yi as s,
|
|
2736
|
+
wn as t,
|
|
2737
|
+
Ht as u,
|
|
2738
|
+
bn as v,
|
|
2739
|
+
Vi as w
|
|
2719
2740
|
};
|