@huyooo/ui 2.0.11 → 2.0.12
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-gE5wTmN1.js → AuthkitAppSetting-Dgxd5GMR.js} +525 -519
- package/dist/{LegalDocViewer-B01O4nWg.js → LegalDocViewer-BWTrNIUE.js} +722 -719
- package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-DnDKhQgo.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-CwB8zI6u.js} +1 -1
- package/dist/{WidthContainer-DP-vFuMF.js → WidthContainer-TAMNaEHp.js} +1 -1
- package/dist/authkit.js +2 -2
- package/dist/common.js +1 -1
- package/dist/composables/Authkit/useAuthkitPasskey.d.ts +4 -1
- package/dist/main.js +4 -4
- package/dist/style.css +1 -1
- package/dist/types/api/auth.generated.d.ts +45 -8
- 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
|
|
5
|
-
import { Avatar as Ee, Input as Q, Textarea as
|
|
3
|
+
import { U as qe } 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 E, toDisplayString as U, createBlock as I, onUnmounted as Ae, withDirectives as Le, vShow as Me, onMounted as de, Fragment as ie, createSlots as Ke, normalizeClass as Pe, renderList as Fe, watch as Ie } from "vue";
|
|
5
|
+
import { Avatar as Ee, Input as Q, Textarea as He, Button as T, Message as G, Form as le, FormItem as L, Alert as Y, Space as me, Popconfirm as We, Link as Ce, InputPassword as Ge, Result as Ye, Modal as Je } from "@arco-design/web-vue";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import { f as
|
|
8
|
-
import { C as
|
|
7
|
+
import { f as je, g as x, b as Qe, h as Re } from "./apiClients-Ctcq8NZs.js";
|
|
8
|
+
import { C as Xe } from "./index-Cn6LcfZO.js";
|
|
9
9
|
/* empty css */
|
|
10
10
|
import { u as ne } from "./useAuthkitUsersProfile-8FzLTfUJ.js";
|
|
11
|
-
import { u as Se, g as
|
|
11
|
+
import { u as Se, g as Ze } 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
|
|
15
|
+
import { C as et } from "./CustomTable-HDwqEcmB.js";
|
|
16
16
|
import { u as Ve } from "./useAuthkitAppsAuthPageInfo-DZ1p-P3Q.js";
|
|
17
|
-
import { Icon as
|
|
18
|
-
import { i as
|
|
19
|
-
import { u as
|
|
20
|
-
import { u as
|
|
21
|
-
const
|
|
17
|
+
import { Icon as tt } from "@iconify/vue";
|
|
18
|
+
import { i as it, M as nt } from "./Menu-uCexrsKP.js";
|
|
19
|
+
import { u as at } from "./useAuthkitAuth-cHrJMM8E.js";
|
|
20
|
+
import { u as ot } from "./useAuthkitCreateAndUpdate-Bbv7vZZn.js";
|
|
21
|
+
const st = {
|
|
22
22
|
class: "personal-information"
|
|
23
|
-
}, st = {
|
|
24
|
-
class: "profile-card"
|
|
25
23
|
}, lt = {
|
|
26
|
-
class: "profile-
|
|
24
|
+
class: "profile-card"
|
|
27
25
|
}, rt = {
|
|
26
|
+
class: "profile-field profile-field--nickname"
|
|
27
|
+
}, ut = {
|
|
28
28
|
class: "nickname-field"
|
|
29
|
-
},
|
|
29
|
+
}, dt = ["disabled"], ct = {
|
|
30
30
|
class: "profile-field"
|
|
31
|
-
},
|
|
31
|
+
}, ft = {
|
|
32
32
|
key: 0,
|
|
33
33
|
class: "profile-actions"
|
|
34
|
-
}, ft = {
|
|
35
|
-
class: "profile-card profile-card--meta"
|
|
36
34
|
}, pt = {
|
|
37
|
-
class: "
|
|
35
|
+
class: "profile-card profile-card--meta"
|
|
38
36
|
}, mt = {
|
|
39
|
-
class: "account-
|
|
37
|
+
class: "account-meta"
|
|
40
38
|
}, vt = {
|
|
41
39
|
class: "account-meta__row"
|
|
42
40
|
}, ht = {
|
|
43
41
|
class: "account-meta__row"
|
|
44
42
|
}, yt = {
|
|
45
43
|
class: "account-meta__row"
|
|
46
|
-
}, gt =
|
|
44
|
+
}, gt = {
|
|
45
|
+
class: "account-meta__row"
|
|
46
|
+
}, wt = 1e3, bt = /* @__PURE__ */ J({
|
|
47
47
|
__name: "AuthkitPersonalInformation",
|
|
48
48
|
props: {
|
|
49
49
|
size: {
|
|
@@ -56,11 +56,11 @@ const ot = {
|
|
|
56
56
|
emit: i
|
|
57
57
|
}) {
|
|
58
58
|
const a = i, {
|
|
59
|
-
fetchUserProfile:
|
|
59
|
+
fetchUserProfile: u
|
|
60
60
|
} = ne(), {
|
|
61
61
|
config: s,
|
|
62
62
|
upload: d
|
|
63
|
-
} = Se(),
|
|
63
|
+
} = Se(), l = e, t = A({
|
|
64
64
|
id: void 0,
|
|
65
65
|
nickname: "",
|
|
66
66
|
description: "",
|
|
@@ -68,7 +68,7 @@ const ot = {
|
|
|
68
68
|
avatarUrl: "",
|
|
69
69
|
email: "",
|
|
70
70
|
phone: ""
|
|
71
|
-
}),
|
|
71
|
+
}), h = A({
|
|
72
72
|
nickname: "",
|
|
73
73
|
description: ""
|
|
74
74
|
}), g = A({
|
|
@@ -76,9 +76,9 @@ const ot = {
|
|
|
76
76
|
createAt: "",
|
|
77
77
|
status: "",
|
|
78
78
|
loginIdentity: "-"
|
|
79
|
-
}), f = A(!1), v = A(!1), r = $(() => t.value.nickname !==
|
|
80
|
-
function
|
|
81
|
-
|
|
79
|
+
}), f = A(!1), v = A(!1), r = $(() => t.value.nickname !== h.value.nickname || t.value.description !== h.value.description);
|
|
80
|
+
function p() {
|
|
81
|
+
h.value = {
|
|
82
82
|
nickname: t.value.nickname,
|
|
83
83
|
description: t.value.description
|
|
84
84
|
};
|
|
@@ -88,21 +88,21 @@ const ot = {
|
|
|
88
88
|
id: V.id,
|
|
89
89
|
createAt: V.createAt || "-",
|
|
90
90
|
status: V.status || "",
|
|
91
|
-
loginIdentity:
|
|
92
|
-
},
|
|
91
|
+
loginIdentity: Qe(V)
|
|
92
|
+
}, p();
|
|
93
93
|
}
|
|
94
94
|
async function R() {
|
|
95
95
|
v.value = !0;
|
|
96
96
|
const {
|
|
97
97
|
data: V,
|
|
98
98
|
error: w
|
|
99
|
-
} = await
|
|
99
|
+
} = await x().auth.users.profile.post({});
|
|
100
100
|
if (v.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 = h.value.nickname, t.value.description = h.value.description;
|
|
106
106
|
}
|
|
107
107
|
async function K() {
|
|
108
108
|
if (!t.value.id)
|
|
@@ -116,8 +116,8 @@ const ot = {
|
|
|
116
116
|
}, {
|
|
117
117
|
data: w,
|
|
118
118
|
error: q
|
|
119
|
-
} = await
|
|
120
|
-
v.value = !1, !q && w && (G.success("更新成功"), t.value.avatarUrl = w.avatarUrl || t.value.avatarUrl,
|
|
119
|
+
} = await x().auth.users.update.baseInfo.post(V);
|
|
120
|
+
v.value = !1, !q && w && (G.success("更新成功"), t.value.avatarUrl = w.avatarUrl || t.value.avatarUrl, p(), await u(), a("submit"));
|
|
121
121
|
}
|
|
122
122
|
function j() {
|
|
123
123
|
const V = document.createElement("input");
|
|
@@ -140,71 +140,71 @@ const ot = {
|
|
|
140
140
|
f.value = !1, G.error((N == null ? void 0 : N.message) || "头像上传失败"), V.remove();
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
|
-
const F = await
|
|
143
|
+
const F = await x().auth.users.update.baseInfo.post({
|
|
144
144
|
id: t.value.id,
|
|
145
145
|
nickname: t.value.nickname,
|
|
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 u(), a("submit")), V.remove();
|
|
150
150
|
}), V.click();
|
|
151
151
|
}
|
|
152
|
-
return R(), (V, w) => (
|
|
152
|
+
return R(), (V, w) => (y(), M("div", st, [z("section", lt, [w[6] || (w[6] = z("h3", {
|
|
153
153
|
class: "profile-card__title"
|
|
154
|
-
}, "个人资料", -1)), z("div",
|
|
154
|
+
}, "个人资料", -1)), z("div", rt, [w[2] || (w[2] = z("label", {
|
|
155
155
|
class: "profile-field__label"
|
|
156
|
-
}, "昵称", -1)), z("div",
|
|
156
|
+
}, "昵称", -1)), z("div", ut, [z("button", {
|
|
157
157
|
type: "button",
|
|
158
158
|
class: "nickname-field__avatar",
|
|
159
159
|
disabled: f.value,
|
|
160
160
|
title: "更换头像",
|
|
161
161
|
onClick: j
|
|
162
|
-
}, [
|
|
162
|
+
}, [m(n(Ee), {
|
|
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, dt), 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: l.size,
|
|
171
171
|
placeholder: "例如:小明"
|
|
172
|
-
}, null, 8, ["modelValue", "size"])])]), z("div",
|
|
172
|
+
}, null, 8, ["modelValue", "size"])])]), z("div", ct, [w[3] || (w[3] = z("label", {
|
|
173
173
|
class: "profile-field__label"
|
|
174
|
-
}, "个人简介", -1)),
|
|
174
|
+
}, "个人简介", -1)), m(n(He), {
|
|
175
175
|
modelValue: t.value.description,
|
|
176
176
|
"onUpdate:modelValue": w[1] || (w[1] = (q) => t.value.description = q),
|
|
177
|
-
size:
|
|
177
|
+
size: l.size,
|
|
178
178
|
placeholder: "介绍一下你自己",
|
|
179
|
-
"max-length":
|
|
179
|
+
"max-length": wt,
|
|
180
180
|
"show-word-limit": "",
|
|
181
181
|
"auto-size": {
|
|
182
182
|
minRows: 4,
|
|
183
183
|
maxRows: 8
|
|
184
184
|
}
|
|
185
|
-
}, null, 8, ["modelValue", "size"])]), r.value ? (
|
|
186
|
-
size:
|
|
185
|
+
}, null, 8, ["modelValue", "size"])]), r.value ? (y(), M("div", ft, [m(n(T), {
|
|
186
|
+
size: l.size,
|
|
187
187
|
onClick: B
|
|
188
188
|
}, {
|
|
189
189
|
default: o(() => [...w[4] || (w[4] = [k("取消", -1)])]),
|
|
190
190
|
_: 1
|
|
191
|
-
}, 8, ["size"]),
|
|
191
|
+
}, 8, ["size"]), m(n(T), {
|
|
192
192
|
type: "primary",
|
|
193
|
-
size:
|
|
193
|
+
size: l.size,
|
|
194
194
|
loading: v.value,
|
|
195
195
|
onClick: K
|
|
196
196
|
}, {
|
|
197
197
|
default: o(() => [...w[5] || (w[5] = [k(" 保存修改 ", -1)])]),
|
|
198
198
|
_: 1
|
|
199
|
-
}, 8, ["size", "loading"])])) : E("", !0)]), z("section",
|
|
199
|
+
}, 8, ["size", "loading"])])) : E("", !0)]), z("section", pt, [w[11] || (w[11] = z("h3", {
|
|
200
200
|
class: "profile-card__title"
|
|
201
|
-
}, "账号信息", -1)), z("dl",
|
|
201
|
+
}, "账号信息", -1)), z("dl", mt, [z("div", vt, [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(Xe, {
|
|
202
202
|
key: 0,
|
|
203
203
|
value: g.value.id,
|
|
204
204
|
message: "用户 ID 已复制"
|
|
205
|
-
}, null, 8, ["value"])) : E("", !0)])]), z("div",
|
|
205
|
+
}, null, 8, ["value"])) : E("", !0)])]), z("div", ht, [w[8] || (w[8] = z("dt", null, "注册时间", -1)), z("dd", null, U(g.value.createAt || "-"), 1)]), z("div", yt, [w[9] || (w[9] = z("dt", null, "账号状态", -1)), z("dd", null, U(n(je)(g.value.status)), 1)]), z("div", gt, [w[10] || (w[10] = z("dt", null, "登录标识", -1)), z("dd", null, U(g.value.loginIdentity), 1)])])])]));
|
|
206
206
|
}
|
|
207
|
-
}),
|
|
207
|
+
}), _t = /* @__PURE__ */ X(bt, [["__scopeId", "data-v-e03e688b"]]), kt = /* @__PURE__ */ J({
|
|
208
208
|
__name: "AuthkitSendVerifyCode",
|
|
209
209
|
props: {
|
|
210
210
|
size: {
|
|
@@ -222,11 +222,11 @@ const ot = {
|
|
|
222
222
|
expose: i,
|
|
223
223
|
emit: a
|
|
224
224
|
}) {
|
|
225
|
-
const
|
|
226
|
-
let
|
|
227
|
-
const t = A(0),
|
|
225
|
+
const u = a, s = e, d = A(!1);
|
|
226
|
+
let l;
|
|
227
|
+
const t = A(0), h = $(() => t.value.toString().padStart(2, "0")), g = $(() => t.value > 0);
|
|
228
228
|
function f() {
|
|
229
|
-
|
|
229
|
+
l && (clearInterval(l), l = void 0);
|
|
230
230
|
}
|
|
231
231
|
function v() {
|
|
232
232
|
if (d.value) {
|
|
@@ -238,16 +238,16 @@ const ot = {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
function r() {
|
|
241
|
-
|
|
241
|
+
u("send");
|
|
242
242
|
}
|
|
243
|
-
function
|
|
244
|
-
!Number.isFinite(S) || S <= 0 || (t.value = Math.ceil(S), d.value = !0, f(),
|
|
243
|
+
function p(S) {
|
|
244
|
+
!Number.isFinite(S) || S <= 0 || (t.value = Math.ceil(S), d.value = !0, f(), l = setInterval(v, 1e3));
|
|
245
245
|
}
|
|
246
246
|
return i({
|
|
247
|
-
startCountFn:
|
|
247
|
+
startCountFn: p
|
|
248
248
|
}), Ae(() => {
|
|
249
249
|
f();
|
|
250
|
-
}), (S, R) => (
|
|
250
|
+
}), (S, R) => (y(), I(n(T), {
|
|
251
251
|
class: "OAuthItem",
|
|
252
252
|
type: "primary",
|
|
253
253
|
size: s.size,
|
|
@@ -255,14 +255,14 @@ const ot = {
|
|
|
255
255
|
loading: s.loading,
|
|
256
256
|
onClick: r
|
|
257
257
|
}, {
|
|
258
|
-
default: o(() => [R[0] || (R[0] = z("span", null, " 发送验证码", -1)),
|
|
258
|
+
default: o(() => [R[0] || (R[0] = z("span", null, " 发送验证码", -1)), Le(z("span", {
|
|
259
259
|
class: "verify-code-timer"
|
|
260
|
-
}, U(`(${
|
|
260
|
+
}, U(`(${h.value})`), 513), [[Me, g.value]])]),
|
|
261
261
|
_: 1
|
|
262
262
|
}, 8, ["size", "disabled", "loading"]));
|
|
263
263
|
}
|
|
264
|
-
}), he = /* @__PURE__ */ X(
|
|
265
|
-
function
|
|
264
|
+
}), he = /* @__PURE__ */ X(kt, [["__scopeId", "data-v-63c6fb3a"]]);
|
|
265
|
+
function At(e) {
|
|
266
266
|
if (!e)
|
|
267
267
|
return null;
|
|
268
268
|
const i = e.match(/请\s*(\d+)\s*秒后再试/);
|
|
@@ -272,19 +272,19 @@ function kt(e) {
|
|
|
272
272
|
return Number.isFinite(a) && a > 0 ? a : null;
|
|
273
273
|
}
|
|
274
274
|
function ke(e) {
|
|
275
|
-
var a,
|
|
275
|
+
var a, u;
|
|
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 : At((u = e.error) == null ? void 0 : u.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 zt = {
|
|
284
284
|
class: "sendVerifyCodeItem"
|
|
285
|
-
},
|
|
285
|
+
}, Pt = {
|
|
286
286
|
class: "handle"
|
|
287
|
-
},
|
|
287
|
+
}, It = /* @__PURE__ */ J({
|
|
288
288
|
__name: "AuthkitEmailVerify",
|
|
289
289
|
props: {
|
|
290
290
|
email: {
|
|
@@ -301,40 +301,40 @@ const At = {
|
|
|
301
301
|
setup(e, {
|
|
302
302
|
emit: i
|
|
303
303
|
}) {
|
|
304
|
-
const a = i,
|
|
304
|
+
const a = i, u = e, s = $(() => Re(u.email)), d = A(), l = A(!1), t = A(!1), h = A(), g = A({
|
|
305
305
|
userToken: void 0,
|
|
306
306
|
emailVerifyId: void 0
|
|
307
307
|
});
|
|
308
308
|
async function f() {
|
|
309
|
-
|
|
310
|
-
const r = await
|
|
311
|
-
email:
|
|
309
|
+
l.value = !0;
|
|
310
|
+
const r = await x().auth.verify.email.retry.post({
|
|
311
|
+
email: u.email,
|
|
312
312
|
purpose: "bindEmail"
|
|
313
313
|
});
|
|
314
|
-
|
|
314
|
+
l.value = !1, r.data && (g.value.emailVerifyId = r.data.emailVerifyId), ye(d.value, r);
|
|
315
315
|
}
|
|
316
316
|
async function v() {
|
|
317
|
-
if (!await
|
|
317
|
+
if (!await h.value.validate(["userToken"])) {
|
|
318
318
|
t.value = !0;
|
|
319
319
|
const {
|
|
320
|
-
error:
|
|
321
|
-
} = await
|
|
322
|
-
email:
|
|
320
|
+
error: p
|
|
321
|
+
} = await x().auth.verify.email.post({
|
|
322
|
+
email: u.email,
|
|
323
323
|
userToken: g.value.userToken,
|
|
324
324
|
emailVerifyId: g.value.emailVerifyId,
|
|
325
325
|
purpose: "bindEmail"
|
|
326
326
|
});
|
|
327
|
-
t.value = !1,
|
|
327
|
+
t.value = !1, p || a("next");
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
return (r,
|
|
330
|
+
return (r, p) => (y(), I(n(le), {
|
|
331
331
|
ref_key: "formRef",
|
|
332
|
-
ref:
|
|
332
|
+
ref: h,
|
|
333
333
|
model: g.value,
|
|
334
334
|
"auto-label-width": "",
|
|
335
|
-
size:
|
|
335
|
+
size: u.size
|
|
336
336
|
}, {
|
|
337
|
-
default: o(() => [
|
|
337
|
+
default: o(() => [m(n(L), {
|
|
338
338
|
field: "email",
|
|
339
339
|
label: "邮箱",
|
|
340
340
|
rules: [{
|
|
@@ -347,7 +347,7 @@ const At = {
|
|
|
347
347
|
}, {
|
|
348
348
|
default: o(() => [k(U(s.value), 1)]),
|
|
349
349
|
_: 1
|
|
350
|
-
}),
|
|
350
|
+
}), m(n(L), {
|
|
351
351
|
field: "userToken",
|
|
352
352
|
label: "验证码",
|
|
353
353
|
"hide-label": "",
|
|
@@ -356,32 +356,32 @@ const At = {
|
|
|
356
356
|
message: "请输入验证码"
|
|
357
357
|
}]
|
|
358
358
|
}, {
|
|
359
|
-
default: o(() => [z("div",
|
|
359
|
+
default: o(() => [z("div", zt, [m(n(Q), {
|
|
360
360
|
modelValue: g.value.userToken,
|
|
361
|
-
"onUpdate:modelValue":
|
|
361
|
+
"onUpdate:modelValue": p[0] || (p[0] = (S) => g.value.userToken = S),
|
|
362
362
|
placeholder: "请输入验证码"
|
|
363
|
-
}, null, 8, ["modelValue"]),
|
|
363
|
+
}, null, 8, ["modelValue"]), m(he, {
|
|
364
364
|
ref_key: "SendVerifyCodeRef",
|
|
365
365
|
ref: d,
|
|
366
|
-
size:
|
|
367
|
-
loading:
|
|
366
|
+
size: u.size,
|
|
367
|
+
loading: l.value,
|
|
368
368
|
style: {
|
|
369
369
|
"margin-left": "10px"
|
|
370
370
|
},
|
|
371
371
|
onSend: f
|
|
372
372
|
}, null, 8, ["size", "loading"])])]),
|
|
373
373
|
_: 1
|
|
374
|
-
}),
|
|
374
|
+
}), m(n(L), {
|
|
375
375
|
field: "",
|
|
376
376
|
label: "",
|
|
377
377
|
rules: []
|
|
378
378
|
}, {
|
|
379
|
-
default: o(() => [z("div",
|
|
379
|
+
default: o(() => [z("div", Pt, [m(n(T), {
|
|
380
380
|
loading: t.value,
|
|
381
381
|
type: "primary",
|
|
382
382
|
onClick: v
|
|
383
383
|
}, {
|
|
384
|
-
default: o(() => [...
|
|
384
|
+
default: o(() => [...p[1] || (p[1] = [k(" 提交 ", -1)])]),
|
|
385
385
|
_: 1
|
|
386
386
|
}, 8, ["loading"])])]),
|
|
387
387
|
_: 1
|
|
@@ -389,11 +389,11 @@ const At = {
|
|
|
389
389
|
_: 1
|
|
390
390
|
}, 8, ["model", "size"]));
|
|
391
391
|
}
|
|
392
|
-
}), ge = /* @__PURE__ */ X(
|
|
392
|
+
}), ge = /* @__PURE__ */ X(It, [["__scopeId", "data-v-0939d925"]]), Et = {
|
|
393
393
|
class: "sendVerifyCodeItem"
|
|
394
|
-
},
|
|
394
|
+
}, Ct = {
|
|
395
395
|
class: "handle"
|
|
396
|
-
},
|
|
396
|
+
}, Rt = /* @__PURE__ */ J({
|
|
397
397
|
__name: "AuthkitPhoneVerify",
|
|
398
398
|
props: {
|
|
399
399
|
phone: {
|
|
@@ -413,47 +413,47 @@ const At = {
|
|
|
413
413
|
setup(e, {
|
|
414
414
|
emit: i
|
|
415
415
|
}) {
|
|
416
|
-
const a = i,
|
|
416
|
+
const a = i, u = e, s = A(), d = A(!1), l = A(!1), t = A(), h = A({
|
|
417
417
|
code: void 0
|
|
418
418
|
}), g = $(() => {
|
|
419
|
-
const r =
|
|
419
|
+
const r = u.phone.trim();
|
|
420
420
|
return r.length < 7 ? r : `${r.slice(0, 3)}****${r.slice(-4)}`;
|
|
421
421
|
});
|
|
422
422
|
async function f() {
|
|
423
423
|
d.value = !0;
|
|
424
|
-
const r = await
|
|
425
|
-
phone:
|
|
426
|
-
purpose:
|
|
424
|
+
const r = await x().auth.verify.sms.send.post({
|
|
425
|
+
phone: u.phone,
|
|
426
|
+
purpose: u.purpose
|
|
427
427
|
});
|
|
428
428
|
d.value = !1, ye(s.value, r);
|
|
429
429
|
}
|
|
430
430
|
async function v() {
|
|
431
431
|
if (!await t.value.validate(["code"])) {
|
|
432
|
-
|
|
432
|
+
l.value = !0;
|
|
433
433
|
const {
|
|
434
|
-
error:
|
|
435
|
-
} = await
|
|
436
|
-
phone:
|
|
437
|
-
code:
|
|
438
|
-
purpose:
|
|
434
|
+
error: p
|
|
435
|
+
} = await x().auth.verify.sms.verify.post({
|
|
436
|
+
phone: u.phone,
|
|
437
|
+
code: h.value.code,
|
|
438
|
+
purpose: u.purpose
|
|
439
439
|
});
|
|
440
|
-
|
|
440
|
+
l.value = !1, p || a("next");
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
-
return (r,
|
|
443
|
+
return (r, p) => (y(), I(n(le), {
|
|
444
444
|
ref_key: "formRef",
|
|
445
445
|
ref: t,
|
|
446
|
-
model:
|
|
446
|
+
model: h.value,
|
|
447
447
|
"auto-label-width": "",
|
|
448
|
-
size:
|
|
448
|
+
size: u.size
|
|
449
449
|
}, {
|
|
450
|
-
default: o(() => [
|
|
450
|
+
default: o(() => [m(n(L), {
|
|
451
451
|
field: "phone",
|
|
452
452
|
label: "手机号"
|
|
453
453
|
}, {
|
|
454
454
|
default: o(() => [k(U(g.value), 1)]),
|
|
455
455
|
_: 1
|
|
456
|
-
}),
|
|
456
|
+
}), m(n(L), {
|
|
457
457
|
field: "code",
|
|
458
458
|
label: "验证码",
|
|
459
459
|
"hide-label": "",
|
|
@@ -462,14 +462,14 @@ const At = {
|
|
|
462
462
|
message: "请输入验证码"
|
|
463
463
|
}]
|
|
464
464
|
}, {
|
|
465
|
-
default: o(() => [z("div",
|
|
466
|
-
modelValue:
|
|
467
|
-
"onUpdate:modelValue":
|
|
465
|
+
default: o(() => [z("div", Et, [m(n(Q), {
|
|
466
|
+
modelValue: h.value.code,
|
|
467
|
+
"onUpdate:modelValue": p[0] || (p[0] = (S) => h.value.code = S),
|
|
468
468
|
placeholder: "请输入验证码"
|
|
469
|
-
}, null, 8, ["modelValue"]),
|
|
469
|
+
}, null, 8, ["modelValue"]), m(he, {
|
|
470
470
|
ref_key: "sendVerifyCodeRef",
|
|
471
471
|
ref: s,
|
|
472
|
-
size:
|
|
472
|
+
size: u.size,
|
|
473
473
|
loading: d.value,
|
|
474
474
|
style: {
|
|
475
475
|
"margin-left": "10px"
|
|
@@ -477,17 +477,17 @@ const At = {
|
|
|
477
477
|
onSend: f
|
|
478
478
|
}, null, 8, ["size", "loading"])])]),
|
|
479
479
|
_: 1
|
|
480
|
-
}),
|
|
480
|
+
}), m(n(L), {
|
|
481
481
|
field: "",
|
|
482
482
|
label: "",
|
|
483
483
|
rules: []
|
|
484
484
|
}, {
|
|
485
|
-
default: o(() => [z("div",
|
|
486
|
-
loading:
|
|
485
|
+
default: o(() => [z("div", Ct, [m(n(T), {
|
|
486
|
+
loading: l.value,
|
|
487
487
|
type: "primary",
|
|
488
488
|
onClick: v
|
|
489
489
|
}, {
|
|
490
|
-
default: o(() => [...
|
|
490
|
+
default: o(() => [...p[1] || (p[1] = [k("提交", -1)])]),
|
|
491
491
|
_: 1
|
|
492
492
|
}, 8, ["loading"])])]),
|
|
493
493
|
_: 1
|
|
@@ -495,9 +495,9 @@ const At = {
|
|
|
495
495
|
_: 1
|
|
496
496
|
}, 8, ["model", "size"]));
|
|
497
497
|
}
|
|
498
|
-
}), we = /* @__PURE__ */ X(
|
|
498
|
+
}), we = /* @__PURE__ */ X(Rt, [["__scopeId", "data-v-d26a59d3"]]), St = {
|
|
499
499
|
class: "handle"
|
|
500
|
-
},
|
|
500
|
+
}, Vt = /* @__PURE__ */ J({
|
|
501
501
|
__name: "AuthkitPasswordUpdate",
|
|
502
502
|
props: {
|
|
503
503
|
size: {
|
|
@@ -513,7 +513,7 @@ const At = {
|
|
|
513
513
|
setup(e, {
|
|
514
514
|
emit: i
|
|
515
515
|
}) {
|
|
516
|
-
const a = i,
|
|
516
|
+
const a = i, u = A(!1), s = A(), d = e, l = A({
|
|
517
517
|
oldPassword: "",
|
|
518
518
|
password: "",
|
|
519
519
|
confirmPassword: ""
|
|
@@ -525,31 +525,31 @@ const At = {
|
|
|
525
525
|
message: "确认密码不能少于10字符"
|
|
526
526
|
}, {
|
|
527
527
|
validator: (g, f) => {
|
|
528
|
-
g !==
|
|
528
|
+
g !== l.value.password ? f("两次密码输入不一致,请重新输入") : f();
|
|
529
529
|
}
|
|
530
530
|
}];
|
|
531
|
-
async function
|
|
531
|
+
async function h() {
|
|
532
532
|
if (!await s.value.validate()) {
|
|
533
|
-
|
|
533
|
+
u.value = !0;
|
|
534
534
|
const f = d.requireOldPassword ? {
|
|
535
|
-
password:
|
|
536
|
-
oldPassword:
|
|
535
|
+
password: l.value.password,
|
|
536
|
+
oldPassword: l.value.oldPassword
|
|
537
537
|
} : {
|
|
538
|
-
password:
|
|
538
|
+
password: l.value.password
|
|
539
539
|
}, {
|
|
540
540
|
error: v
|
|
541
|
-
} = await
|
|
542
|
-
|
|
541
|
+
} = await x().auth.users.update.password.post(f);
|
|
542
|
+
u.value = !1, v || a("submit", f);
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
return (g, f) => (
|
|
545
|
+
return (g, f) => (y(), I(n(le), {
|
|
546
546
|
ref_key: "formRef",
|
|
547
547
|
ref: s,
|
|
548
|
-
model:
|
|
548
|
+
model: l.value,
|
|
549
549
|
"auto-label-width": "",
|
|
550
550
|
size: d.size
|
|
551
551
|
}, {
|
|
552
|
-
default: o(() => [d.requireOldPassword ? (
|
|
552
|
+
default: o(() => [d.requireOldPassword ? (y(), I(n(L), {
|
|
553
553
|
key: 0,
|
|
554
554
|
field: "oldPassword",
|
|
555
555
|
label: "当前密码",
|
|
@@ -559,14 +559,14 @@ const At = {
|
|
|
559
559
|
message: "请输入当前密码"
|
|
560
560
|
}]
|
|
561
561
|
}, {
|
|
562
|
-
default: o(() => [
|
|
563
|
-
modelValue:
|
|
564
|
-
"onUpdate:modelValue": f[0] || (f[0] = (v) =>
|
|
562
|
+
default: o(() => [m(n(Q), {
|
|
563
|
+
modelValue: l.value.oldPassword,
|
|
564
|
+
"onUpdate:modelValue": f[0] || (f[0] = (v) => l.value.oldPassword = v),
|
|
565
565
|
placeholder: "请输入当前密码",
|
|
566
566
|
type: "password"
|
|
567
567
|
}, null, 8, ["modelValue"])]),
|
|
568
568
|
_: 1
|
|
569
|
-
})) : E("", !0),
|
|
569
|
+
})) : E("", !0), m(n(L), {
|
|
570
570
|
field: "password",
|
|
571
571
|
label: d.requireOldPassword ? "新密码" : "登录密码",
|
|
572
572
|
"hide-label": "",
|
|
@@ -578,35 +578,35 @@ const At = {
|
|
|
578
578
|
message: "密码不能少于10字符"
|
|
579
579
|
}]
|
|
580
580
|
}, {
|
|
581
|
-
default: o(() => [
|
|
582
|
-
modelValue:
|
|
583
|
-
"onUpdate:modelValue": f[1] || (f[1] = (v) =>
|
|
581
|
+
default: o(() => [m(n(Q), {
|
|
582
|
+
modelValue: l.value.password,
|
|
583
|
+
"onUpdate:modelValue": f[1] || (f[1] = (v) => l.value.password = v),
|
|
584
584
|
placeholder: d.requireOldPassword ? "请输入新密码" : "请输入登录密码",
|
|
585
585
|
type: "password"
|
|
586
586
|
}, null, 8, ["modelValue", "placeholder"])]),
|
|
587
587
|
_: 1
|
|
588
|
-
}, 8, ["label", "rules"]),
|
|
588
|
+
}, 8, ["label", "rules"]), m(n(L), {
|
|
589
589
|
field: "confirmPassword",
|
|
590
590
|
label: "确认密码",
|
|
591
591
|
"hide-label": "",
|
|
592
592
|
rules: t
|
|
593
593
|
}, {
|
|
594
|
-
default: o(() => [
|
|
595
|
-
modelValue:
|
|
596
|
-
"onUpdate:modelValue": f[2] || (f[2] = (v) =>
|
|
594
|
+
default: o(() => [m(n(Q), {
|
|
595
|
+
modelValue: l.value.confirmPassword,
|
|
596
|
+
"onUpdate:modelValue": f[2] || (f[2] = (v) => l.value.confirmPassword = v),
|
|
597
597
|
placeholder: "请输入确认密码",
|
|
598
598
|
type: "password"
|
|
599
599
|
}, null, 8, ["modelValue"])]),
|
|
600
600
|
_: 1
|
|
601
|
-
}),
|
|
601
|
+
}), m(n(L), {
|
|
602
602
|
field: "",
|
|
603
603
|
label: "",
|
|
604
604
|
rules: []
|
|
605
605
|
}, {
|
|
606
|
-
default: o(() => [z("div",
|
|
606
|
+
default: o(() => [z("div", St, [m(n(T), {
|
|
607
607
|
type: "primary",
|
|
608
|
-
loading:
|
|
609
|
-
onClick:
|
|
608
|
+
loading: u.value,
|
|
609
|
+
onClick: h
|
|
610
610
|
}, {
|
|
611
611
|
default: o(() => [...f[3] || (f[3] = [k("提交", -1)])]),
|
|
612
612
|
_: 1
|
|
@@ -616,7 +616,7 @@ const At = {
|
|
|
616
616
|
_: 1
|
|
617
617
|
}, 8, ["model", "size"]));
|
|
618
618
|
}
|
|
619
|
-
}),
|
|
619
|
+
}), $t = /* @__PURE__ */ X(Vt, [["__scopeId", "data-v-627d759a"]]), Tt = /* @__PURE__ */ J({
|
|
620
620
|
__name: "AuthkitSetPassword",
|
|
621
621
|
props: {
|
|
622
622
|
size: {
|
|
@@ -628,37 +628,37 @@ const At = {
|
|
|
628
628
|
const {
|
|
629
629
|
userProfile: i,
|
|
630
630
|
fetchUserProfile: a,
|
|
631
|
-
isLoggedIn:
|
|
631
|
+
isLoggedIn: u
|
|
632
632
|
} = ne(), s = A("hidden"), d = e;
|
|
633
|
-
function
|
|
633
|
+
function l(g) {
|
|
634
634
|
s.value = g;
|
|
635
635
|
}
|
|
636
636
|
function t(g) {
|
|
637
637
|
var f;
|
|
638
638
|
G.success((f = i.value) != null && f.hasPassword ? "密码修改成功" : "密码设置成功"), s.value = "hidden", a();
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function h() {
|
|
641
641
|
s.value = "update";
|
|
642
642
|
}
|
|
643
643
|
return de(() => {
|
|
644
|
-
|
|
644
|
+
u.value && !i.value && a();
|
|
645
645
|
}), (g, f) => {
|
|
646
|
-
var v, r,
|
|
647
|
-
return
|
|
646
|
+
var v, r, p, S, R, B, K, j, V;
|
|
647
|
+
return y(), M(ie, null, [!((v = n(i)) != null && v.email) && !((r = n(i)) != null && r.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
|
-
})) : E("", !0), ((
|
|
654
|
+
})) : E("", !0), ((p = n(i)) != null && p.email || (S = n(i)) != null && S.phone) && s.value === "hidden" ? (y(), I(n(Y), {
|
|
655
655
|
key: 1,
|
|
656
656
|
title: (R = n(i)) != null && R.hasPassword ? "更改密码" : "设置登录密码"
|
|
657
657
|
}, {
|
|
658
|
-
action: o(() => [
|
|
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) => l("verify"))
|
|
662
662
|
}, {
|
|
663
663
|
default: o(() => {
|
|
664
664
|
var w;
|
|
@@ -671,21 +671,21 @@ const At = {
|
|
|
671
671
|
return [k(U((w = n(i)) != null && w.hasPassword ? "为了账户安全,修改密码前会先验证身份。" : "设置登录密码前会先验证身份。") + " ", 1)];
|
|
672
672
|
}),
|
|
673
673
|
_: 1
|
|
674
|
-
}, 8, ["title"])) : E("", !0), s.value === "update" ? (
|
|
674
|
+
}, 8, ["title"])) : E("", !0), s.value === "update" ? (y(), I($t, {
|
|
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"])) : E("", !0), s.value === "verify" && ((K = n(i)) != null && K.email) ? (
|
|
679
|
+
}, null, 8, ["size", "require-old-password"])) : E("", !0), s.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"])) : E("", !0), s.value === "verify" && !((j = n(i)) != null && j.email) && ((V = n(i)) != null && V.phone) ? (
|
|
683
|
+
onNext: h
|
|
684
|
+
}, null, 8, ["size", "email"])) : E("", !0), s.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:
|
|
688
|
+
onNext: h
|
|
689
689
|
}, null, 8, ["size", "phone"])) : E("", !0)], 64);
|
|
690
690
|
};
|
|
691
691
|
}
|
|
@@ -703,9 +703,9 @@ function ee(e) {
|
|
|
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,
|
|
706
|
+
const i = e.replace(/-/g, "+").replace(/_/g, "/"), a = (4 - i.length % 4) % 4, u = i.padEnd(i.length + a, "="), s = atob(u), d = new ArrayBuffer(s.length), l = new Uint8Array(d);
|
|
707
707
|
for (let t = 0; t < s.length; t++)
|
|
708
|
-
|
|
708
|
+
l[t] = s.charCodeAt(t);
|
|
709
709
|
return d;
|
|
710
710
|
}
|
|
711
711
|
function be() {
|
|
@@ -728,19 +728,19 @@ class W extends Error {
|
|
|
728
728
|
constructor({
|
|
729
729
|
message: i,
|
|
730
730
|
code: a,
|
|
731
|
-
cause:
|
|
731
|
+
cause: u,
|
|
732
732
|
name: s
|
|
733
733
|
}) {
|
|
734
734
|
super(i, {
|
|
735
|
-
cause:
|
|
736
|
-
}), this.name = s ??
|
|
735
|
+
cause: u
|
|
736
|
+
}), this.name = s ?? u.name, this.code = a;
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
|
-
function
|
|
739
|
+
function Ut({
|
|
740
740
|
error: e,
|
|
741
741
|
options: i
|
|
742
742
|
}) {
|
|
743
|
-
var
|
|
743
|
+
var u, s, d;
|
|
744
744
|
const {
|
|
745
745
|
publicKey: a
|
|
746
746
|
} = i;
|
|
@@ -754,7 +754,7 @@ function Tt({
|
|
|
754
754
|
cause: e
|
|
755
755
|
});
|
|
756
756
|
} else if (e.name === "ConstraintError") {
|
|
757
|
-
if (((
|
|
757
|
+
if (((u = a.authenticatorSelection) == null ? void 0 : u.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",
|
|
@@ -796,9 +796,9 @@ function Tt({
|
|
|
796
796
|
cause: e
|
|
797
797
|
});
|
|
798
798
|
if (e.name === "SecurityError") {
|
|
799
|
-
const
|
|
800
|
-
if (Te(
|
|
801
|
-
if (a.rp.id !==
|
|
799
|
+
const l = window.location.hostname;
|
|
800
|
+
if (Te(l)) {
|
|
801
|
+
if (a.rp.id !== l)
|
|
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 Tt({
|
|
|
825
825
|
}
|
|
826
826
|
return e;
|
|
827
827
|
}
|
|
828
|
-
class
|
|
828
|
+
class xt {
|
|
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 Ut {
|
|
|
841
841
|
}
|
|
842
842
|
}
|
|
843
843
|
}
|
|
844
|
-
const Ue = new
|
|
845
|
-
function
|
|
844
|
+
const Ue = new xt(), Ot = ["cross-platform", "platform"];
|
|
845
|
+
function xe(e) {
|
|
846
846
|
if (e && !(Ot.indexOf(e) < 0))
|
|
847
847
|
return e;
|
|
848
848
|
}
|
|
849
|
-
async function
|
|
849
|
+
async function Nt(e) {
|
|
850
850
|
var S;
|
|
851
851
|
const {
|
|
852
852
|
optionsJSON: i,
|
|
@@ -854,7 +854,7 @@ async function xt(e) {
|
|
|
854
854
|
} = e;
|
|
855
855
|
if (!be())
|
|
856
856
|
throw new Error("WebAuthn is not supported in this browser");
|
|
857
|
-
const
|
|
857
|
+
const u = {
|
|
858
858
|
...i,
|
|
859
859
|
challenge: ve(i.challenge),
|
|
860
860
|
user: {
|
|
@@ -863,12 +863,12 @@ async function xt(e) {
|
|
|
863
863
|
},
|
|
864
864
|
excludeCredentials: (S = i.excludeCredentials) == null ? void 0 : S.map($e)
|
|
865
865
|
}, s = {};
|
|
866
|
-
a && (s.mediation = "conditional"), s.publicKey =
|
|
866
|
+
a && (s.mediation = "conditional"), s.publicKey = u, s.signal = Ue.createNewAbortSignal();
|
|
867
867
|
let d;
|
|
868
868
|
try {
|
|
869
869
|
d = await navigator.credentials.create(s);
|
|
870
870
|
} catch (R) {
|
|
871
|
-
throw
|
|
871
|
+
throw Ut({
|
|
872
872
|
error: R,
|
|
873
873
|
options: s
|
|
874
874
|
});
|
|
@@ -876,56 +876,56 @@ async function xt(e) {
|
|
|
876
876
|
if (!d)
|
|
877
877
|
throw new Error("Registration was not completed");
|
|
878
878
|
const {
|
|
879
|
-
id:
|
|
879
|
+
id: l,
|
|
880
880
|
rawId: t,
|
|
881
|
-
response:
|
|
881
|
+
response: h,
|
|
882
882
|
type: g
|
|
883
883
|
} = d;
|
|
884
884
|
let f;
|
|
885
|
-
typeof
|
|
885
|
+
typeof h.getTransports == "function" && (f = h.getTransports());
|
|
886
886
|
let v;
|
|
887
|
-
if (typeof
|
|
887
|
+
if (typeof h.getPublicKeyAlgorithm == "function")
|
|
888
888
|
try {
|
|
889
|
-
v =
|
|
889
|
+
v = h.getPublicKeyAlgorithm();
|
|
890
890
|
} catch (R) {
|
|
891
891
|
_e("getPublicKeyAlgorithm()", R);
|
|
892
892
|
}
|
|
893
893
|
let r;
|
|
894
|
-
if (typeof
|
|
894
|
+
if (typeof h.getPublicKey == "function")
|
|
895
895
|
try {
|
|
896
|
-
const R =
|
|
896
|
+
const R = h.getPublicKey();
|
|
897
897
|
R !== null && (r = ee(R));
|
|
898
898
|
} catch (R) {
|
|
899
899
|
_e("getPublicKey()", R);
|
|
900
900
|
}
|
|
901
|
-
let
|
|
902
|
-
if (typeof
|
|
901
|
+
let p;
|
|
902
|
+
if (typeof h.getAuthenticatorData == "function")
|
|
903
903
|
try {
|
|
904
|
-
|
|
904
|
+
p = ee(h.getAuthenticatorData());
|
|
905
905
|
} catch (R) {
|
|
906
906
|
_e("getAuthenticatorData()", R);
|
|
907
907
|
}
|
|
908
908
|
return {
|
|
909
|
-
id:
|
|
909
|
+
id: l,
|
|
910
910
|
rawId: ee(t),
|
|
911
911
|
response: {
|
|
912
|
-
attestationObject: ee(
|
|
913
|
-
clientDataJSON: ee(
|
|
912
|
+
attestationObject: ee(h.attestationObject),
|
|
913
|
+
clientDataJSON: ee(h.clientDataJSON),
|
|
914
914
|
transports: f,
|
|
915
915
|
publicKeyAlgorithm: v,
|
|
916
916
|
publicKey: r,
|
|
917
|
-
authenticatorData:
|
|
917
|
+
authenticatorData: p
|
|
918
918
|
},
|
|
919
919
|
type: g,
|
|
920
920
|
clientExtensionResults: d.getClientExtensionResults(),
|
|
921
|
-
authenticatorAttachment:
|
|
921
|
+
authenticatorAttachment: xe(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 Oe() {
|
|
929
929
|
if (!be())
|
|
930
930
|
return new Promise((i) => i(!1));
|
|
931
931
|
const e = window.PublicKeyCredential;
|
|
@@ -955,9 +955,9 @@ function Dt({
|
|
|
955
955
|
cause: e
|
|
956
956
|
});
|
|
957
957
|
if (e.name === "SecurityError") {
|
|
958
|
-
const
|
|
959
|
-
if (Te(
|
|
960
|
-
if (a.rpId !==
|
|
958
|
+
const u = window.location.hostname;
|
|
959
|
+
if (Te(u)) {
|
|
960
|
+
if (a.rpId !== u)
|
|
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",
|
|
@@ -978,49 +978,49 @@ function Dt({
|
|
|
978
978
|
return e;
|
|
979
979
|
}
|
|
980
980
|
async function Bt(e) {
|
|
981
|
-
var
|
|
981
|
+
var p, S;
|
|
982
982
|
const {
|
|
983
983
|
optionsJSON: i,
|
|
984
984
|
useBrowserAutofill: a = !1,
|
|
985
|
-
verifyBrowserAutofillInput:
|
|
985
|
+
verifyBrowserAutofillInput: u = !0
|
|
986
986
|
} = e;
|
|
987
987
|
if (!be())
|
|
988
988
|
throw new Error("WebAuthn is not supported in this browser");
|
|
989
989
|
let s;
|
|
990
|
-
((
|
|
990
|
+
((p = i.allowCredentials) == null ? void 0 : p.length) !== 0 && (s = (S = i.allowCredentials) == null ? void 0 : S.map($e));
|
|
991
991
|
const d = {
|
|
992
992
|
...i,
|
|
993
993
|
challenge: ve(i.challenge),
|
|
994
994
|
allowCredentials: s
|
|
995
|
-
},
|
|
995
|
+
}, l = {};
|
|
996
996
|
if (a) {
|
|
997
|
-
if (!await
|
|
997
|
+
if (!await Oe())
|
|
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 && u)
|
|
1000
1000
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
1001
|
-
|
|
1001
|
+
l.mediation = "conditional", d.allowCredentials = [];
|
|
1002
1002
|
}
|
|
1003
|
-
|
|
1003
|
+
l.publicKey = d, l.signal = Ue.createNewAbortSignal();
|
|
1004
1004
|
let t;
|
|
1005
1005
|
try {
|
|
1006
|
-
t = await navigator.credentials.get(
|
|
1006
|
+
t = await navigator.credentials.get(l);
|
|
1007
1007
|
} catch (R) {
|
|
1008
1008
|
throw Dt({
|
|
1009
1009
|
error: R,
|
|
1010
|
-
options:
|
|
1010
|
+
options: l
|
|
1011
1011
|
});
|
|
1012
1012
|
}
|
|
1013
1013
|
if (!t)
|
|
1014
1014
|
throw new Error("Authentication was not completed");
|
|
1015
1015
|
const {
|
|
1016
|
-
id:
|
|
1016
|
+
id: h,
|
|
1017
1017
|
rawId: g,
|
|
1018
1018
|
response: f,
|
|
1019
1019
|
type: v
|
|
1020
1020
|
} = t;
|
|
1021
1021
|
let r;
|
|
1022
1022
|
return f.userHandle && (r = ee(f.userHandle)), {
|
|
1023
|
-
id:
|
|
1023
|
+
id: h,
|
|
1024
1024
|
rawId: ee(g),
|
|
1025
1025
|
response: {
|
|
1026
1026
|
authenticatorData: ee(f.authenticatorData),
|
|
@@ -1030,7 +1030,7 @@ async function Bt(e) {
|
|
|
1030
1030
|
},
|
|
1031
1031
|
type: v,
|
|
1032
1032
|
clientExtensionResults: t.getClientExtensionResults(),
|
|
1033
|
-
authenticatorAttachment:
|
|
1033
|
+
authenticatorAttachment: xe(t.authenticatorAttachment)
|
|
1034
1034
|
};
|
|
1035
1035
|
}
|
|
1036
1036
|
function qt() {
|
|
@@ -1051,50 +1051,57 @@ function Kt() {
|
|
|
1051
1051
|
}
|
|
1052
1052
|
function Ft() {
|
|
1053
1053
|
const e = A(!1), i = qt();
|
|
1054
|
-
async function a(d) {
|
|
1055
|
-
const
|
|
1056
|
-
if (
|
|
1057
|
-
throw new Error(
|
|
1058
|
-
|
|
1054
|
+
async function a(d, l) {
|
|
1055
|
+
const t = se();
|
|
1056
|
+
if (t)
|
|
1057
|
+
throw new Error(t);
|
|
1058
|
+
const h = (l == null ? void 0 : l.useBrowserAutofill) === !0;
|
|
1059
|
+
if (h && !await Oe())
|
|
1060
|
+
return null;
|
|
1061
|
+
h || (e.value = !0);
|
|
1059
1062
|
try {
|
|
1060
1063
|
const {
|
|
1061
|
-
data:
|
|
1062
|
-
error:
|
|
1063
|
-
} = await
|
|
1064
|
+
data: g,
|
|
1065
|
+
error: f
|
|
1066
|
+
} = await x().auth.passkey.auth.options.post({
|
|
1064
1067
|
email: (d == null ? void 0 : d.trim()) || void 0
|
|
1065
1068
|
});
|
|
1066
|
-
if (
|
|
1069
|
+
if (f || !g)
|
|
1067
1070
|
return null;
|
|
1068
|
-
const
|
|
1069
|
-
optionsJSON:
|
|
1070
|
-
|
|
1071
|
-
data: f,
|
|
1072
|
-
error: v
|
|
1073
|
-
} = await O().auth.passkey.auth.verify.post({
|
|
1074
|
-
response: g
|
|
1071
|
+
const v = await Bt({
|
|
1072
|
+
optionsJSON: g,
|
|
1073
|
+
useBrowserAutofill: h
|
|
1075
1074
|
});
|
|
1076
|
-
|
|
1075
|
+
if (l != null && l.beforeVerify && !l.beforeVerify())
|
|
1076
|
+
return null;
|
|
1077
|
+
const {
|
|
1078
|
+
data: r,
|
|
1079
|
+
error: p
|
|
1080
|
+
} = await x().auth.passkey.auth.verify.post({
|
|
1081
|
+
response: v
|
|
1082
|
+
});
|
|
1083
|
+
return p || !r ? null : r;
|
|
1077
1084
|
} finally {
|
|
1078
|
-
e.value = !1;
|
|
1085
|
+
h || (e.value = !1);
|
|
1079
1086
|
}
|
|
1080
1087
|
}
|
|
1081
|
-
async function
|
|
1082
|
-
const
|
|
1083
|
-
if (
|
|
1084
|
-
throw new Error(
|
|
1088
|
+
async function u(d) {
|
|
1089
|
+
const l = se();
|
|
1090
|
+
if (l)
|
|
1091
|
+
throw new Error(l);
|
|
1085
1092
|
e.value = !0;
|
|
1086
1093
|
try {
|
|
1087
1094
|
const {
|
|
1088
1095
|
data: t,
|
|
1089
|
-
error:
|
|
1090
|
-
} = await
|
|
1091
|
-
if (
|
|
1096
|
+
error: h
|
|
1097
|
+
} = await x().auth.passkey.register.options.post();
|
|
1098
|
+
if (h || !t)
|
|
1092
1099
|
return !1;
|
|
1093
|
-
const g = await
|
|
1100
|
+
const g = await Nt({
|
|
1094
1101
|
optionsJSON: t
|
|
1095
1102
|
}), {
|
|
1096
1103
|
error: f
|
|
1097
|
-
} = await
|
|
1104
|
+
} = await x().auth.passkey.register.verify.post({
|
|
1098
1105
|
response: g,
|
|
1099
1106
|
name: (d == null ? void 0 : d.trim()) || Kt()
|
|
1100
1107
|
});
|
|
@@ -1110,7 +1117,7 @@ function Ft() {
|
|
|
1110
1117
|
loading: e,
|
|
1111
1118
|
supported: i,
|
|
1112
1119
|
loginWithPasskey: a,
|
|
1113
|
-
registerPasskey:
|
|
1120
|
+
registerPasskey: u,
|
|
1114
1121
|
formatError: s,
|
|
1115
1122
|
getPasskeyEnvironmentIssue: se
|
|
1116
1123
|
};
|
|
@@ -1134,13 +1141,13 @@ const Ht = {
|
|
|
1134
1141
|
setup(e) {
|
|
1135
1142
|
const i = e, {
|
|
1136
1143
|
userProfile: a
|
|
1137
|
-
} = ne(),
|
|
1144
|
+
} = ne(), u = A(!1), s = A(!1), d = A([]), l = se(), {
|
|
1138
1145
|
registerPasskey: t,
|
|
1139
|
-
formatError:
|
|
1146
|
+
formatError: h
|
|
1140
1147
|
} = Ft(), g = A(""), f = A(!1), v = A(), r = $(() => {
|
|
1141
1148
|
var _, P;
|
|
1142
1149
|
return !!((_ = a.value) != null && _.email || (P = a.value) != null && P.phone);
|
|
1143
|
-
}),
|
|
1150
|
+
}), p = $(() => r.value && !v.value), S = [{
|
|
1144
1151
|
title: "通行密钥",
|
|
1145
1152
|
dataIndex: "name",
|
|
1146
1153
|
minWidth: fe.name,
|
|
@@ -1168,12 +1175,12 @@ const Ht = {
|
|
|
1168
1175
|
cellClassName: "passkey-actions-cell"
|
|
1169
1176
|
}];
|
|
1170
1177
|
async function R() {
|
|
1171
|
-
|
|
1178
|
+
u.value = !0;
|
|
1172
1179
|
const {
|
|
1173
1180
|
data: _,
|
|
1174
1181
|
error: P
|
|
1175
|
-
} = await
|
|
1176
|
-
if (
|
|
1182
|
+
} = await x().auth.passkey.list.post();
|
|
1183
|
+
if (u.value = !1, P || !_) {
|
|
1177
1184
|
d.value = [];
|
|
1178
1185
|
return;
|
|
1179
1186
|
}
|
|
@@ -1186,7 +1193,7 @@ const Ht = {
|
|
|
1186
1193
|
return;
|
|
1187
1194
|
G.success("Passkey 添加成功"), await R();
|
|
1188
1195
|
} catch (_) {
|
|
1189
|
-
G.error(
|
|
1196
|
+
G.error(h(_));
|
|
1190
1197
|
} finally {
|
|
1191
1198
|
s.value = !1;
|
|
1192
1199
|
}
|
|
@@ -1217,7 +1224,7 @@ const Ht = {
|
|
|
1217
1224
|
return;
|
|
1218
1225
|
const {
|
|
1219
1226
|
error: _
|
|
1220
|
-
} = await
|
|
1227
|
+
} = await x().auth.passkey.delete.post({
|
|
1221
1228
|
credentialId: g.value
|
|
1222
1229
|
});
|
|
1223
1230
|
_ || (G.success("已移除"), await R()), w();
|
|
@@ -1226,7 +1233,7 @@ const Ht = {
|
|
|
1226
1233
|
R();
|
|
1227
1234
|
}), (_, P) => {
|
|
1228
1235
|
var N, F;
|
|
1229
|
-
return
|
|
1236
|
+
return y(), M("div", Ht, [m(n(Y), {
|
|
1230
1237
|
type: "info",
|
|
1231
1238
|
style: {
|
|
1232
1239
|
"margin-bottom": "16px"
|
|
@@ -1234,19 +1241,19 @@ const Ht = {
|
|
|
1234
1241
|
}, {
|
|
1235
1242
|
default: o(() => [...P[2] || (P[2] = [k(" Passkey 使用设备生物识别(指纹 / 面容)登录,绑定后可在登录页一键验证身份。 ", -1)])]),
|
|
1236
1243
|
_: 1
|
|
1237
|
-
}), n(
|
|
1244
|
+
}), n(l) ? (y(), M("div", Wt, U(n(l)), 1)) : E("", !0), g.value && !f.value ? (y(), I(n(Y), {
|
|
1238
1245
|
key: 1,
|
|
1239
1246
|
type: "warning",
|
|
1240
1247
|
title: "移除前验证身份"
|
|
1241
|
-
},
|
|
1248
|
+
}, Ke({
|
|
1242
1249
|
default: o(() => [P[6] || (P[6] = k(" 移除 Passkey 前请先完成身份验证。 ", -1))]),
|
|
1243
1250
|
_: 2
|
|
1244
|
-
}, [
|
|
1251
|
+
}, [p.value ? {
|
|
1245
1252
|
name: "action",
|
|
1246
|
-
fn: o(() => [
|
|
1253
|
+
fn: o(() => [m(n(me), null, {
|
|
1247
1254
|
default: o(() => {
|
|
1248
1255
|
var D, Z;
|
|
1249
|
-
return [(D = n(a)) != null && D.email ? (
|
|
1256
|
+
return [(D = n(a)) != null && D.email ? (y(), I(n(T), {
|
|
1250
1257
|
key: 0,
|
|
1251
1258
|
size: i.size,
|
|
1252
1259
|
type: "primary",
|
|
@@ -1254,7 +1261,7 @@ const Ht = {
|
|
|
1254
1261
|
}, {
|
|
1255
1262
|
default: o(() => [...P[3] || (P[3] = [k(" 邮箱验证 ", -1)])]),
|
|
1256
1263
|
_: 1
|
|
1257
|
-
}, 8, ["size"])) : E("", !0), (Z = n(a)) != null && Z.phone ? (
|
|
1264
|
+
}, 8, ["size"])) : E("", !0), (Z = n(a)) != null && Z.phone ? (y(), I(n(T), {
|
|
1258
1265
|
key: 1,
|
|
1259
1266
|
size: i.size,
|
|
1260
1267
|
type: "primary",
|
|
@@ -1262,7 +1269,7 @@ const Ht = {
|
|
|
1262
1269
|
}, {
|
|
1263
1270
|
default: o(() => [...P[4] || (P[4] = [k(" 手机验证 ", -1)])]),
|
|
1264
1271
|
_: 1
|
|
1265
|
-
}, 8, ["size"])) : E("", !0),
|
|
1272
|
+
}, 8, ["size"])) : E("", !0), m(n(T), {
|
|
1266
1273
|
size: i.size,
|
|
1267
1274
|
onClick: w
|
|
1268
1275
|
}, {
|
|
@@ -1273,30 +1280,30 @@ const Ht = {
|
|
|
1273
1280
|
_: 1
|
|
1274
1281
|
})]),
|
|
1275
1282
|
key: "0"
|
|
1276
|
-
} : void 0]), 1024)) : E("", !0), g.value && v.value === "email" && ((N = n(a)) != null && N.email) ? (
|
|
1283
|
+
} : void 0]), 1024)) : E("", !0), g.value && v.value === "email" && ((N = n(a)) != null && N.email) ? (y(), I(ge, {
|
|
1277
1284
|
key: 2,
|
|
1278
1285
|
size: i.size,
|
|
1279
1286
|
email: n(a).email,
|
|
1280
1287
|
onNext: V
|
|
1281
|
-
}, null, 8, ["size", "email"])) : E("", !0), g.value && v.value === "phone" && ((F = n(a)) != null && F.phone) ? (
|
|
1288
|
+
}, null, 8, ["size", "email"])) : E("", !0), g.value && v.value === "phone" && ((F = n(a)) != null && F.phone) ? (y(), I(we, {
|
|
1282
1289
|
key: 3,
|
|
1283
1290
|
size: i.size,
|
|
1284
1291
|
phone: n(a).phone,
|
|
1285
1292
|
onNext: V
|
|
1286
|
-
}, null, 8, ["size", "phone"])) : E("", !0), g.value ? E("", !0) : (
|
|
1293
|
+
}, null, 8, ["size", "phone"])) : E("", !0), g.value ? E("", !0) : (y(), M("div", Gt, [m(n(T), {
|
|
1287
1294
|
type: "primary",
|
|
1288
1295
|
size: i.size,
|
|
1289
1296
|
loading: s.value,
|
|
1290
|
-
disabled: !!n(
|
|
1297
|
+
disabled: !!n(l),
|
|
1291
1298
|
onClick: B
|
|
1292
1299
|
}, {
|
|
1293
1300
|
default: o(() => [...P[7] || (P[7] = [k(" 添加 Passkey ", -1)])]),
|
|
1294
1301
|
_: 1
|
|
1295
|
-
}, 8, ["size", "loading", "disabled"])])), g.value ? E("", !0) : (
|
|
1302
|
+
}, 8, ["size", "loading", "disabled"])])), g.value ? E("", !0) : (y(), I(et, {
|
|
1296
1303
|
key: 5,
|
|
1297
1304
|
columns: S,
|
|
1298
1305
|
data: d.value,
|
|
1299
|
-
loading:
|
|
1306
|
+
loading: u.value,
|
|
1300
1307
|
pagination: !1,
|
|
1301
1308
|
bordered: !1,
|
|
1302
1309
|
"row-key": "credentialId"
|
|
@@ -1309,11 +1316,11 @@ const Ht = {
|
|
|
1309
1316
|
}) => [k(U(D.createdAt || "-"), 1)]),
|
|
1310
1317
|
actions: o(({
|
|
1311
1318
|
record: D
|
|
1312
|
-
}) => [
|
|
1319
|
+
}) => [m(n(We), {
|
|
1313
1320
|
content: "确定移除此 Passkey?移除后将无法使用该设备登录",
|
|
1314
1321
|
onOk: (Z) => K(D.credentialId)
|
|
1315
1322
|
}, {
|
|
1316
|
-
default: o(() => [
|
|
1323
|
+
default: o(() => [m(n(T), {
|
|
1317
1324
|
type: "text",
|
|
1318
1325
|
status: "danger",
|
|
1319
1326
|
size: i.size
|
|
@@ -1372,15 +1379,15 @@ const Ht = {
|
|
|
1372
1379
|
setup(e, {
|
|
1373
1380
|
emit: i
|
|
1374
1381
|
}) {
|
|
1375
|
-
const a = i,
|
|
1382
|
+
const a = i, u = e, s = A(), d = A(!1), l = A(), t = A({
|
|
1376
1383
|
email: void 0,
|
|
1377
1384
|
userToken: void 0,
|
|
1378
1385
|
emailVerifyId: void 0
|
|
1379
1386
|
});
|
|
1380
|
-
async function
|
|
1381
|
-
if (!await
|
|
1387
|
+
async function h() {
|
|
1388
|
+
if (!await l.value.validateField(["email"])) {
|
|
1382
1389
|
d.value = !0;
|
|
1383
|
-
const r = await
|
|
1390
|
+
const r = await x().auth.verify.email.retry.post({
|
|
1384
1391
|
email: t.value.email,
|
|
1385
1392
|
purpose: "bindEmail"
|
|
1386
1393
|
});
|
|
@@ -1388,7 +1395,7 @@ const Ht = {
|
|
|
1388
1395
|
}
|
|
1389
1396
|
}
|
|
1390
1397
|
async function g() {
|
|
1391
|
-
|
|
1398
|
+
l.value.validate().then((v) => {
|
|
1392
1399
|
v || a("submit", {
|
|
1393
1400
|
email: t.value.email,
|
|
1394
1401
|
userToken: t.value.userToken,
|
|
@@ -1399,20 +1406,20 @@ const Ht = {
|
|
|
1399
1406
|
function f() {
|
|
1400
1407
|
a("skip");
|
|
1401
1408
|
}
|
|
1402
|
-
return (v, r) => (
|
|
1409
|
+
return (v, r) => (y(), M("div", jt, [m(n(Y), {
|
|
1403
1410
|
type: "info",
|
|
1404
|
-
title:
|
|
1411
|
+
title: u.title
|
|
1405
1412
|
}, {
|
|
1406
|
-
default: o(() => [k(U(
|
|
1413
|
+
default: o(() => [k(U(u.subtitle), 1)]),
|
|
1407
1414
|
_: 1
|
|
1408
|
-
}, 8, ["title"]), z("div", Qt, [
|
|
1415
|
+
}, 8, ["title"]), z("div", Qt, [m(n(le), {
|
|
1409
1416
|
ref_key: "formRef",
|
|
1410
|
-
ref:
|
|
1417
|
+
ref: l,
|
|
1411
1418
|
model: t.value,
|
|
1412
|
-
size:
|
|
1419
|
+
size: u.size,
|
|
1413
1420
|
"auto-label-width": ""
|
|
1414
1421
|
}, {
|
|
1415
|
-
default: o(() => [
|
|
1422
|
+
default: o(() => [m(n(L), {
|
|
1416
1423
|
field: "email",
|
|
1417
1424
|
label: "邮箱",
|
|
1418
1425
|
"hide-label": "",
|
|
@@ -1424,15 +1431,15 @@ const Ht = {
|
|
|
1424
1431
|
message: "请输入有效的邮箱"
|
|
1425
1432
|
}]
|
|
1426
1433
|
}, {
|
|
1427
|
-
default: o(() => [
|
|
1434
|
+
default: o(() => [m(n(Q), {
|
|
1428
1435
|
modelValue: t.value.email,
|
|
1429
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
1436
|
+
"onUpdate:modelValue": r[0] || (r[0] = (p) => t.value.email = p),
|
|
1430
1437
|
placeholder: "请输入邮箱",
|
|
1431
1438
|
autocomplete: "email",
|
|
1432
1439
|
type: "email"
|
|
1433
1440
|
}, null, 8, ["modelValue"])]),
|
|
1434
1441
|
_: 1
|
|
1435
|
-
}),
|
|
1442
|
+
}), m(n(L), {
|
|
1436
1443
|
field: "userToken",
|
|
1437
1444
|
label: "验证码",
|
|
1438
1445
|
"hide-label": "",
|
|
@@ -1441,34 +1448,34 @@ const Ht = {
|
|
|
1441
1448
|
message: "请输入验证码"
|
|
1442
1449
|
}]
|
|
1443
1450
|
}, {
|
|
1444
|
-
default: o(() => [z("div", Xt, [
|
|
1451
|
+
default: o(() => [z("div", Xt, [m(n(Q), {
|
|
1445
1452
|
modelValue: t.value.userToken,
|
|
1446
|
-
"onUpdate:modelValue": r[1] || (r[1] = (
|
|
1453
|
+
"onUpdate:modelValue": r[1] || (r[1] = (p) => t.value.userToken = p),
|
|
1447
1454
|
placeholder: "请输入验证码",
|
|
1448
1455
|
autocomplete: "one-time-code"
|
|
1449
|
-
}, null, 8, ["modelValue"]),
|
|
1456
|
+
}, null, 8, ["modelValue"]), m(he, {
|
|
1450
1457
|
ref_key: "SendVerifyCodeRef",
|
|
1451
1458
|
ref: s,
|
|
1452
|
-
size:
|
|
1459
|
+
size: u.size,
|
|
1453
1460
|
loading: d.value,
|
|
1454
1461
|
style: {
|
|
1455
1462
|
"margin-left": "10px"
|
|
1456
1463
|
},
|
|
1457
|
-
onSend:
|
|
1464
|
+
onSend: h
|
|
1458
1465
|
}, null, 8, ["size", "loading"])])]),
|
|
1459
1466
|
_: 1
|
|
1460
|
-
}), z("div", Zt, [
|
|
1467
|
+
}), z("div", Zt, [m(n(T), {
|
|
1461
1468
|
type: "primary",
|
|
1462
|
-
loading:
|
|
1469
|
+
loading: u.loading,
|
|
1463
1470
|
long: "",
|
|
1464
|
-
size:
|
|
1471
|
+
size: u.size,
|
|
1465
1472
|
onClick: g
|
|
1466
1473
|
}, {
|
|
1467
|
-
default: o(() => [k(U(
|
|
1474
|
+
default: o(() => [k(U(u.submitText), 1)]),
|
|
1468
1475
|
_: 1
|
|
1469
1476
|
}, 8, ["loading", "size"])])]),
|
|
1470
1477
|
_: 1
|
|
1471
|
-
}, 8, ["model", "size"])]),
|
|
1478
|
+
}, 8, ["model", "size"])]), u.showSkip ? (y(), M("div", ei, [m(n(Ce), {
|
|
1472
1479
|
onClick: f
|
|
1473
1480
|
}, {
|
|
1474
1481
|
default: o(() => [...r[2] || (r[2] = [k("稍后绑定", -1)])]),
|
|
@@ -1487,61 +1494,61 @@ const Ht = {
|
|
|
1487
1494
|
const {
|
|
1488
1495
|
userProfile: i,
|
|
1489
1496
|
loading: a,
|
|
1490
|
-
fetchUserProfile:
|
|
1491
|
-
} = ne(), s = A("hidden"), d = A(!1),
|
|
1497
|
+
fetchUserProfile: u
|
|
1498
|
+
} = ne(), s = A("hidden"), d = A(!1), l = e, t = $(() => {
|
|
1492
1499
|
var v;
|
|
1493
1500
|
return !!((v = i.value) != null && v.email) && d.value;
|
|
1494
1501
|
});
|
|
1495
|
-
function
|
|
1502
|
+
function h(v) {
|
|
1496
1503
|
s.value = v;
|
|
1497
1504
|
}
|
|
1498
1505
|
async function g(v) {
|
|
1499
1506
|
a.value = !0;
|
|
1500
|
-
const r = t.value ?
|
|
1507
|
+
const r = t.value ? x().auth.users.update.myEmail.post({
|
|
1501
1508
|
email: v.email,
|
|
1502
1509
|
userToken: v.userToken,
|
|
1503
1510
|
emailVerifyId: v.emailVerifyId
|
|
1504
|
-
}) :
|
|
1511
|
+
}) : x().auth.auth.bind.email.post({
|
|
1505
1512
|
email: v.email,
|
|
1506
1513
|
userToken: v.userToken,
|
|
1507
1514
|
emailVerifyId: v.emailVerifyId
|
|
1508
1515
|
}), {
|
|
1509
|
-
error:
|
|
1516
|
+
error: p
|
|
1510
1517
|
} = await r;
|
|
1511
|
-
a.value = !1,
|
|
1518
|
+
a.value = !1, p || (G.success(t.value ? "更改成功" : "绑定成功"), s.value = "hidden", d.value = !1, u());
|
|
1512
1519
|
}
|
|
1513
1520
|
function f() {
|
|
1514
1521
|
d.value = !0, s.value = "update";
|
|
1515
1522
|
}
|
|
1516
1523
|
return de(() => {
|
|
1517
|
-
i.value ||
|
|
1524
|
+
i.value || u();
|
|
1518
1525
|
}), (v, r) => {
|
|
1519
|
-
var
|
|
1520
|
-
return
|
|
1526
|
+
var p, S, R;
|
|
1527
|
+
return y(), M(ie, null, [(p = n(i)) != null && p.email && s.value === "hidden" ? (y(), I(n(Y), {
|
|
1521
1528
|
key: 0,
|
|
1522
1529
|
title: "更改邮箱"
|
|
1523
1530
|
}, {
|
|
1524
|
-
action: o(() => [
|
|
1525
|
-
size:
|
|
1531
|
+
action: o(() => [m(n(T), {
|
|
1532
|
+
size: l.size,
|
|
1526
1533
|
type: "primary",
|
|
1527
|
-
onClick: r[0] || (r[0] = (B) =>
|
|
1534
|
+
onClick: r[0] || (r[0] = (B) => h("verify"))
|
|
1528
1535
|
}, {
|
|
1529
1536
|
default: o(() => [...r[1] || (r[1] = [k("更改邮箱", -1)])]),
|
|
1530
1537
|
_: 1
|
|
1531
1538
|
}, 8, ["size"])]),
|
|
1532
1539
|
default: o(() => [k(U(`您绑定的邮箱为 ${n(Re)(n(i).email)}`) + " ", 1)]),
|
|
1533
1540
|
_: 1
|
|
1534
|
-
})) : E("", !0), !((S = n(i)) != null && S.email) || s.value === "update" ? (
|
|
1541
|
+
})) : E("", !0), !((S = n(i)) != null && S.email) || s.value === "update" ? (y(), I(ii, {
|
|
1535
1542
|
key: 1,
|
|
1536
1543
|
loading: n(a),
|
|
1537
|
-
size:
|
|
1544
|
+
size: l.size,
|
|
1538
1545
|
title: t.value ? "更改邮箱" : "绑定邮箱",
|
|
1539
1546
|
subtitle: t.value ? "请输入新的邮箱并完成验证" : "请绑定邮箱以完成账号设置,绑定后可使用邮箱登录",
|
|
1540
1547
|
"submit-text": t.value ? "更改邮箱" : "绑定邮箱",
|
|
1541
1548
|
onSubmit: g
|
|
1542
|
-
}, null, 8, ["loading", "size", "title", "subtitle", "submit-text"])) : E("", !0), s.value === "verify" ? (
|
|
1549
|
+
}, null, 8, ["loading", "size", "title", "subtitle", "submit-text"])) : E("", !0), s.value === "verify" ? (y(), I(ge, {
|
|
1543
1550
|
key: 2,
|
|
1544
|
-
size:
|
|
1551
|
+
size: l.size,
|
|
1545
1552
|
email: (R = n(i)) == null ? void 0 : R.email,
|
|
1546
1553
|
onNext: f
|
|
1547
1554
|
}, null, 8, ["size", "email"])) : E("", !0)], 64);
|
|
@@ -1597,14 +1604,14 @@ const Ht = {
|
|
|
1597
1604
|
setup(e, {
|
|
1598
1605
|
emit: i
|
|
1599
1606
|
}) {
|
|
1600
|
-
const a = i,
|
|
1607
|
+
const a = i, u = e, s = A(), d = A(!1), l = A(), t = A({
|
|
1601
1608
|
phone: void 0,
|
|
1602
1609
|
code: void 0
|
|
1603
1610
|
});
|
|
1604
|
-
async function
|
|
1605
|
-
if (!await
|
|
1611
|
+
async function h() {
|
|
1612
|
+
if (!await l.value.validateField(["phone"])) {
|
|
1606
1613
|
d.value = !0;
|
|
1607
|
-
const r = await
|
|
1614
|
+
const r = await x().auth.verify.sms.send.post({
|
|
1608
1615
|
phone: t.value.phone,
|
|
1609
1616
|
purpose: "bindPhone"
|
|
1610
1617
|
});
|
|
@@ -1612,7 +1619,7 @@ const Ht = {
|
|
|
1612
1619
|
}
|
|
1613
1620
|
}
|
|
1614
1621
|
async function g() {
|
|
1615
|
-
|
|
1622
|
+
l.value.validate().then((v) => {
|
|
1616
1623
|
v || a("submit", {
|
|
1617
1624
|
phone: t.value.phone,
|
|
1618
1625
|
code: t.value.code
|
|
@@ -1622,14 +1629,14 @@ const Ht = {
|
|
|
1622
1629
|
function f() {
|
|
1623
1630
|
a("skip");
|
|
1624
1631
|
}
|
|
1625
|
-
return (v, r) => (
|
|
1632
|
+
return (v, r) => (y(), M("div", ai, [z("div", oi, [z("h3", si, U(u.title), 1), z("p", li, U(u.subtitle), 1)]), z("div", ri, [m(n(le), {
|
|
1626
1633
|
ref_key: "formRef",
|
|
1627
|
-
ref:
|
|
1634
|
+
ref: l,
|
|
1628
1635
|
model: t.value,
|
|
1629
|
-
size:
|
|
1636
|
+
size: u.size,
|
|
1630
1637
|
"auto-label-width": ""
|
|
1631
1638
|
}, {
|
|
1632
|
-
default: o(() => [
|
|
1639
|
+
default: o(() => [m(n(L), {
|
|
1633
1640
|
field: "phone",
|
|
1634
1641
|
label: "手机号",
|
|
1635
1642
|
"hide-label": "",
|
|
@@ -1641,15 +1648,15 @@ const Ht = {
|
|
|
1641
1648
|
message: "请输入有效的手机号"
|
|
1642
1649
|
}]
|
|
1643
1650
|
}, {
|
|
1644
|
-
default: o(() => [
|
|
1651
|
+
default: o(() => [m(n(Q), {
|
|
1645
1652
|
modelValue: t.value.phone,
|
|
1646
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
1653
|
+
"onUpdate:modelValue": r[0] || (r[0] = (p) => t.value.phone = p),
|
|
1647
1654
|
placeholder: "请输入手机号",
|
|
1648
1655
|
autocomplete: "tel",
|
|
1649
1656
|
type: "tel"
|
|
1650
1657
|
}, null, 8, ["modelValue"])]),
|
|
1651
1658
|
_: 1
|
|
1652
|
-
}),
|
|
1659
|
+
}), m(n(L), {
|
|
1653
1660
|
field: "code",
|
|
1654
1661
|
label: "验证码",
|
|
1655
1662
|
"hide-label": "",
|
|
@@ -1658,34 +1665,34 @@ const Ht = {
|
|
|
1658
1665
|
message: "请输入验证码"
|
|
1659
1666
|
}]
|
|
1660
1667
|
}, {
|
|
1661
|
-
default: o(() => [z("div", ui, [
|
|
1668
|
+
default: o(() => [z("div", ui, [m(n(Q), {
|
|
1662
1669
|
modelValue: t.value.code,
|
|
1663
|
-
"onUpdate:modelValue": r[1] || (r[1] = (
|
|
1670
|
+
"onUpdate:modelValue": r[1] || (r[1] = (p) => t.value.code = p),
|
|
1664
1671
|
placeholder: "请输入验证码",
|
|
1665
1672
|
autocomplete: "one-time-code"
|
|
1666
|
-
}, null, 8, ["modelValue"]),
|
|
1673
|
+
}, null, 8, ["modelValue"]), m(he, {
|
|
1667
1674
|
ref_key: "SendVerifyCodeRef",
|
|
1668
1675
|
ref: s,
|
|
1669
|
-
size:
|
|
1676
|
+
size: u.size,
|
|
1670
1677
|
loading: d.value,
|
|
1671
1678
|
style: {
|
|
1672
1679
|
"margin-left": "10px"
|
|
1673
1680
|
},
|
|
1674
|
-
onSend:
|
|
1681
|
+
onSend: h
|
|
1675
1682
|
}, null, 8, ["size", "loading"])])]),
|
|
1676
1683
|
_: 1
|
|
1677
|
-
}), z("div", di, [
|
|
1684
|
+
}), z("div", di, [m(n(T), {
|
|
1678
1685
|
type: "primary",
|
|
1679
|
-
loading:
|
|
1686
|
+
loading: u.loading,
|
|
1680
1687
|
long: "",
|
|
1681
|
-
size:
|
|
1688
|
+
size: u.size,
|
|
1682
1689
|
onClick: g
|
|
1683
1690
|
}, {
|
|
1684
|
-
default: o(() => [k(U(
|
|
1691
|
+
default: o(() => [k(U(u.submitText), 1)]),
|
|
1685
1692
|
_: 1
|
|
1686
1693
|
}, 8, ["loading", "size"])])]),
|
|
1687
1694
|
_: 1
|
|
1688
|
-
}, 8, ["model", "size"])]),
|
|
1695
|
+
}, 8, ["model", "size"])]), u.showSkip ? (y(), M("div", ci, [m(n(Ce), {
|
|
1689
1696
|
onClick: f
|
|
1690
1697
|
}, {
|
|
1691
1698
|
default: o(() => [...r[2] || (r[2] = [k("稍后绑定", -1)])]),
|
|
@@ -1704,78 +1711,78 @@ const Ht = {
|
|
|
1704
1711
|
const {
|
|
1705
1712
|
userProfile: i,
|
|
1706
1713
|
loading: a,
|
|
1707
|
-
fetchUserProfile:
|
|
1708
|
-
} = ne(), s = A("hidden"), d = A(!1),
|
|
1709
|
-
var
|
|
1710
|
-
const r = ((
|
|
1714
|
+
fetchUserProfile: u
|
|
1715
|
+
} = ne(), s = A("hidden"), d = A(!1), l = e, t = $(() => {
|
|
1716
|
+
var p;
|
|
1717
|
+
const r = ((p = i.value) == null ? void 0 : p.phone) || "";
|
|
1711
1718
|
return r.length < 7 ? r : `${r.slice(0, 3)}****${r.slice(-4)}`;
|
|
1712
|
-
}),
|
|
1719
|
+
}), h = $(() => {
|
|
1713
1720
|
var r;
|
|
1714
1721
|
return !!((r = i.value) != null && r.phone) && d.value;
|
|
1715
1722
|
});
|
|
1716
1723
|
function g(r) {
|
|
1717
|
-
var
|
|
1718
|
-
s.value = r, r === "update" && !((
|
|
1724
|
+
var p;
|
|
1725
|
+
s.value = r, r === "update" && !((p = i.value) != null && p.phone) && (d.value = !1);
|
|
1719
1726
|
}
|
|
1720
1727
|
async function f(r) {
|
|
1721
1728
|
a.value = !0;
|
|
1722
|
-
const
|
|
1729
|
+
const p = h.value ? x().auth.users.update.myPhone.post({
|
|
1723
1730
|
phone: r.phone,
|
|
1724
1731
|
code: r.code
|
|
1725
|
-
}) :
|
|
1732
|
+
}) : x().auth.auth.bind.phone.post({
|
|
1726
1733
|
phone: r.phone,
|
|
1727
1734
|
code: r.code
|
|
1728
1735
|
}), {
|
|
1729
1736
|
error: S
|
|
1730
|
-
} = await
|
|
1731
|
-
a.value = !1, S || (G.success(
|
|
1737
|
+
} = await p;
|
|
1738
|
+
a.value = !1, S || (G.success(h.value ? "更改成功" : "绑定成功"), s.value = "hidden", d.value = !1, u());
|
|
1732
1739
|
}
|
|
1733
1740
|
function v() {
|
|
1734
1741
|
d.value = !0, s.value = "update";
|
|
1735
1742
|
}
|
|
1736
1743
|
return de(() => {
|
|
1737
|
-
i.value ||
|
|
1738
|
-
}), (r,
|
|
1744
|
+
i.value || u();
|
|
1745
|
+
}), (r, p) => {
|
|
1739
1746
|
var S, R, B;
|
|
1740
|
-
return
|
|
1747
|
+
return y(), M(ie, null, [!((S = n(i)) != null && S.phone) && s.value === "hidden" ? (y(), I(n(Y), {
|
|
1741
1748
|
key: 0,
|
|
1742
1749
|
title: "绑定手机号"
|
|
1743
1750
|
}, {
|
|
1744
|
-
action: o(() => [
|
|
1745
|
-
size:
|
|
1751
|
+
action: o(() => [m(n(T), {
|
|
1752
|
+
size: l.size,
|
|
1746
1753
|
type: "primary",
|
|
1747
|
-
onClick:
|
|
1754
|
+
onClick: p[0] || (p[0] = (K) => g("update"))
|
|
1748
1755
|
}, {
|
|
1749
|
-
default: o(() => [...
|
|
1756
|
+
default: o(() => [...p[2] || (p[2] = [k("绑定手机号", -1)])]),
|
|
1750
1757
|
_: 1
|
|
1751
1758
|
}, 8, ["size"])]),
|
|
1752
|
-
default: o(() => [
|
|
1759
|
+
default: o(() => [p[3] || (p[3] = k(" 您还未绑定手机号,请点击绑定手机号。 ", -1))]),
|
|
1753
1760
|
_: 1
|
|
1754
|
-
})) : E("", !0), (R = n(i)) != null && R.phone && s.value === "hidden" ? (
|
|
1761
|
+
})) : E("", !0), (R = n(i)) != null && R.phone && s.value === "hidden" ? (y(), I(n(Y), {
|
|
1755
1762
|
key: 1,
|
|
1756
1763
|
title: "已绑定手机号"
|
|
1757
1764
|
}, {
|
|
1758
|
-
action: o(() => [
|
|
1759
|
-
size:
|
|
1765
|
+
action: o(() => [m(n(T), {
|
|
1766
|
+
size: l.size,
|
|
1760
1767
|
type: "primary",
|
|
1761
|
-
onClick:
|
|
1768
|
+
onClick: p[1] || (p[1] = (K) => g("verify"))
|
|
1762
1769
|
}, {
|
|
1763
|
-
default: o(() => [...
|
|
1770
|
+
default: o(() => [...p[4] || (p[4] = [k("更改手机号", -1)])]),
|
|
1764
1771
|
_: 1
|
|
1765
1772
|
}, 8, ["size"])]),
|
|
1766
1773
|
default: o(() => [k(U(`您绑定的手机号为 ${t.value}`) + " ", 1)]),
|
|
1767
1774
|
_: 1
|
|
1768
|
-
})) : E("", !0), s.value === "update" ? (
|
|
1775
|
+
})) : E("", !0), s.value === "update" ? (y(), I(pi, {
|
|
1769
1776
|
key: 2,
|
|
1770
1777
|
loading: n(a),
|
|
1771
|
-
size:
|
|
1772
|
-
title:
|
|
1773
|
-
subtitle:
|
|
1774
|
-
"submit-text":
|
|
1778
|
+
size: l.size,
|
|
1779
|
+
title: h.value ? "更改手机号" : "绑定手机号",
|
|
1780
|
+
subtitle: h.value ? "请输入新的手机号并完成短信验证" : "请绑定手机号以完成账号设置",
|
|
1781
|
+
"submit-text": h.value ? "更改手机号" : "绑定手机号",
|
|
1775
1782
|
onSubmit: f
|
|
1776
|
-
}, null, 8, ["loading", "size", "title", "subtitle", "submit-text"])) : E("", !0), s.value === "verify" ? (
|
|
1783
|
+
}, null, 8, ["loading", "size", "title", "subtitle", "submit-text"])) : E("", !0), s.value === "verify" ? (y(), I(we, {
|
|
1777
1784
|
key: 3,
|
|
1778
|
-
size:
|
|
1785
|
+
size: l.size,
|
|
1779
1786
|
phone: ((B = n(i)) == null ? void 0 : B.phone) || "",
|
|
1780
1787
|
onNext: v
|
|
1781
1788
|
}, null, 8, ["size", "phone"])) : E("", !0)], 64);
|
|
@@ -1793,11 +1800,11 @@ function hi(e) {
|
|
|
1793
1800
|
function gn(e) {
|
|
1794
1801
|
return ze.forEach((i) => e.searchParams.delete(i)), `${e.pathname}${e.search}${e.hash}`;
|
|
1795
1802
|
}
|
|
1796
|
-
function
|
|
1803
|
+
function Ne() {
|
|
1797
1804
|
return new URL(window.location.href);
|
|
1798
1805
|
}
|
|
1799
|
-
function
|
|
1800
|
-
const e =
|
|
1806
|
+
function De() {
|
|
1807
|
+
const e = Ne();
|
|
1801
1808
|
return ze.forEach((i) => e.searchParams.delete(i)), `${e.origin}${e.pathname}${e.search}${e.hash}`;
|
|
1802
1809
|
}
|
|
1803
1810
|
function yi() {
|
|
@@ -1806,7 +1813,7 @@ function yi() {
|
|
|
1806
1813
|
function gi() {
|
|
1807
1814
|
if (typeof window > "u")
|
|
1808
1815
|
return;
|
|
1809
|
-
const e =
|
|
1816
|
+
const e = Ne();
|
|
1810
1817
|
if (hi(e))
|
|
1811
1818
|
return;
|
|
1812
1819
|
const i = `${e.pathname}${e.search}${e.hash}`;
|
|
@@ -1828,27 +1835,27 @@ function bn(e = "/") {
|
|
|
1828
1835
|
return sessionStorage.removeItem(ue), i || e;
|
|
1829
1836
|
}
|
|
1830
1837
|
async function ce(e, i) {
|
|
1831
|
-
const a =
|
|
1838
|
+
const a = Ze().config.appId;
|
|
1832
1839
|
if (!a) {
|
|
1833
1840
|
console.error(`${e} OAuth 失败: appId 未配置`);
|
|
1834
1841
|
return;
|
|
1835
1842
|
}
|
|
1836
1843
|
gi();
|
|
1837
|
-
const
|
|
1844
|
+
const u = De(), s = (i == null ? void 0 : i.inviteCode) || vi() || void 0, d = {
|
|
1838
1845
|
appId: a,
|
|
1839
1846
|
inviteCode: s,
|
|
1840
|
-
redirectUri:
|
|
1847
|
+
redirectUri: u,
|
|
1841
1848
|
acceptedTerms: (i == null ? void 0 : i.acceptedTerms) === !0 ? !0 : void 0
|
|
1842
|
-
},
|
|
1843
|
-
github: () =>
|
|
1844
|
-
google: () =>
|
|
1845
|
-
microsoft: () =>
|
|
1846
|
-
wechat: () =>
|
|
1849
|
+
}, l = {
|
|
1850
|
+
github: () => x().auth.oauth.github.login.get(d),
|
|
1851
|
+
google: () => x().auth.oauth.google.login.get(d),
|
|
1852
|
+
microsoft: () => x().auth.oauth.microsoft.login.get(d),
|
|
1853
|
+
wechat: () => x().auth.oauth.wechat.login.get(d)
|
|
1847
1854
|
}, {
|
|
1848
1855
|
data: t,
|
|
1849
|
-
error:
|
|
1850
|
-
} = await
|
|
1851
|
-
if (!
|
|
1856
|
+
error: h
|
|
1857
|
+
} = await l[e]();
|
|
1858
|
+
if (!h) {
|
|
1852
1859
|
if (t != null && t.redirectUri) {
|
|
1853
1860
|
window.location.href = t.redirectUri;
|
|
1854
1861
|
return;
|
|
@@ -1875,7 +1882,7 @@ function Ai() {
|
|
|
1875
1882
|
microsoftAuth: _i,
|
|
1876
1883
|
wechatAuth: ki,
|
|
1877
1884
|
startOauth: ce,
|
|
1878
|
-
buildLoginOauthRedirectUri:
|
|
1885
|
+
buildLoginOauthRedirectUri: De,
|
|
1879
1886
|
buildBindOauthRedirectUri: yi
|
|
1880
1887
|
};
|
|
1881
1888
|
}
|
|
@@ -1895,13 +1902,13 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
1895
1902
|
},
|
|
1896
1903
|
setup(e) {
|
|
1897
1904
|
const i = e;
|
|
1898
|
-
return (a,
|
|
1905
|
+
return (a, u) => n(it)(i.icon) ? (y(), I(n(tt), {
|
|
1899
1906
|
key: 0,
|
|
1900
1907
|
icon: i.icon,
|
|
1901
1908
|
width: i.size,
|
|
1902
1909
|
height: i.size,
|
|
1903
1910
|
class: Pe(i.class)
|
|
1904
|
-
}, null, 8, ["icon", "width", "height", "class"])) : i.icon ? (
|
|
1911
|
+
}, null, 8, ["icon", "width", "height", "class"])) : i.icon ? (y(), M("img", {
|
|
1905
1912
|
key: 1,
|
|
1906
1913
|
src: i.icon,
|
|
1907
1914
|
alt: i.alt,
|
|
@@ -1929,9 +1936,9 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
1929
1936
|
class: "oauth-binding-account__info"
|
|
1930
1937
|
}, Ui = {
|
|
1931
1938
|
class: "oauth-binding-account__provider"
|
|
1932
|
-
}, Oi = {
|
|
1933
|
-
class: "oauth-binding-account__name"
|
|
1934
1939
|
}, xi = {
|
|
1940
|
+
class: "oauth-binding-account__name"
|
|
1941
|
+
}, Oi = {
|
|
1935
1942
|
class: "oauth-binding-verify-actions"
|
|
1936
1943
|
}, Ni = /* @__PURE__ */ J({
|
|
1937
1944
|
__name: "AuthkitOAuthBinding",
|
|
@@ -1953,21 +1960,21 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
1953
1960
|
const {
|
|
1954
1961
|
config: i
|
|
1955
1962
|
} = Se(), a = e, {
|
|
1956
|
-
userProfile:
|
|
1963
|
+
userProfile: u,
|
|
1957
1964
|
fetchUserProfile: s
|
|
1958
1965
|
} = ne(), {
|
|
1959
1966
|
appsData: d
|
|
1960
1967
|
} = Ve(), {
|
|
1961
|
-
buildBindOauthRedirectUri:
|
|
1962
|
-
} = Ai(), t = A("hidden"),
|
|
1968
|
+
buildBindOauthRedirectUri: l
|
|
1969
|
+
} = Ai(), t = A("hidden"), h = A(), g = A(!1);
|
|
1963
1970
|
let f;
|
|
1964
1971
|
const v = $(() => {
|
|
1965
1972
|
var c;
|
|
1966
|
-
return ((c =
|
|
1973
|
+
return ((c = u.value) == null ? void 0 : c[a.provider]) || null;
|
|
1967
1974
|
}), r = $(() => {
|
|
1968
1975
|
const c = v.value;
|
|
1969
1976
|
return c ? c.login || c.name || c.nickname || c.displayName || c.userPrincipalName || c.email || c.mail || c.openid || a.label : "";
|
|
1970
|
-
}),
|
|
1977
|
+
}), p = $(() => {
|
|
1971
1978
|
const c = v.value;
|
|
1972
1979
|
return (c == null ? void 0 : c.avatar_url) || (c == null ? void 0 : c.picture) || (c == null ? void 0 : c.headimgurl) || "";
|
|
1973
1980
|
}), S = $(() => re[a.provider]), R = $(() => {
|
|
@@ -1978,23 +1985,23 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
1978
1985
|
return c.signUp.phone || c.login.phonePassword || c.login.phoneCode;
|
|
1979
1986
|
}), K = $(() => {
|
|
1980
1987
|
var c;
|
|
1981
|
-
return R.value && !!((c =
|
|
1988
|
+
return R.value && !!((c = u.value) != null && c.email);
|
|
1982
1989
|
}), j = $(() => {
|
|
1983
1990
|
var c;
|
|
1984
|
-
return B.value && !!((c =
|
|
1991
|
+
return B.value && !!((c = u.value) != null && c.phone);
|
|
1985
1992
|
}), V = $(() => {
|
|
1986
1993
|
const c = [];
|
|
1987
1994
|
return K.value && c.push("email"), j.value && c.push("phone"), c;
|
|
1988
|
-
}), w = $(() => R.value || B.value), q = $(() => t.value !== "hidden" && V.value.length > 1 && !
|
|
1995
|
+
}), w = $(() => R.value || B.value), q = $(() => t.value !== "hidden" && V.value.length > 1 && !h.value), _ = $(() => {
|
|
1989
1996
|
var c;
|
|
1990
|
-
return t.value !== "hidden" &&
|
|
1997
|
+
return t.value !== "hidden" && h.value === "email" && !!((c = u.value) != null && c.email);
|
|
1991
1998
|
}), P = $(() => {
|
|
1992
1999
|
var c;
|
|
1993
|
-
return t.value !== "hidden" &&
|
|
2000
|
+
return t.value !== "hidden" && h.value === "phone" && !!((c = u.value) != null && c.phone);
|
|
1994
2001
|
}), N = $(() => t.value === "unbind" ? "解绑" : "绑定");
|
|
1995
2002
|
function F(c) {
|
|
1996
2003
|
if (c === "hidden") {
|
|
1997
|
-
t.value = c,
|
|
2004
|
+
t.value = c, h.value = void 0;
|
|
1998
2005
|
return;
|
|
1999
2006
|
}
|
|
2000
2007
|
if (!w.value) {
|
|
@@ -2006,10 +2013,10 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2006
2013
|
G.error("请先绑定应用已开启的邮箱或手机号后再操作第三方账号");
|
|
2007
2014
|
return;
|
|
2008
2015
|
}
|
|
2009
|
-
t.value = c,
|
|
2016
|
+
t.value = c, h.value = C.length === 1 ? C[0] : void 0;
|
|
2010
2017
|
}
|
|
2011
2018
|
function D(c) {
|
|
2012
|
-
|
|
2019
|
+
h.value = c;
|
|
2013
2020
|
}
|
|
2014
2021
|
async function Z() {
|
|
2015
2022
|
const c = i.appId;
|
|
@@ -2017,7 +2024,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2017
2024
|
console.error(`${a.label} OAuth 失败: appId 未配置`);
|
|
2018
2025
|
return;
|
|
2019
2026
|
}
|
|
2020
|
-
const C =
|
|
2027
|
+
const C = l(), H = x().auth, oe = {
|
|
2021
2028
|
github: () => H.oauth.github.login.get({
|
|
2022
2029
|
appId: c,
|
|
2023
2030
|
mode: "bind",
|
|
@@ -2040,35 +2047,35 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2040
2047
|
})
|
|
2041
2048
|
}, {
|
|
2042
2049
|
data: te,
|
|
2043
|
-
error:
|
|
2050
|
+
error: Be
|
|
2044
2051
|
} = await oe[a.provider]();
|
|
2045
|
-
|
|
2052
|
+
Be || !(te != null && te.redirectUri) || (g.value = !0, window.open(te.redirectUri, "_blank"));
|
|
2046
2053
|
}
|
|
2047
2054
|
async function ae() {
|
|
2048
2055
|
const {
|
|
2049
2056
|
error: c
|
|
2050
|
-
} = await
|
|
2057
|
+
} = await x().auth.users.unbind.oauth.post({
|
|
2051
2058
|
provider: a.provider
|
|
2052
2059
|
});
|
|
2053
2060
|
c || (G.success("解绑成功"), t.value = "hidden", s());
|
|
2054
2061
|
}
|
|
2055
|
-
function
|
|
2062
|
+
function O() {
|
|
2056
2063
|
t.value === "bind" && (t.value = "hidden", Z()), t.value === "unbind" && ae();
|
|
2057
2064
|
}
|
|
2058
2065
|
function b() {
|
|
2059
2066
|
g.value && s();
|
|
2060
2067
|
}
|
|
2061
2068
|
return de(() => {
|
|
2062
|
-
|
|
2069
|
+
u.value || s(), f = setInterval(b, 1e3);
|
|
2063
2070
|
}), Ae(() => {
|
|
2064
2071
|
f && clearInterval(f);
|
|
2065
2072
|
}), (c, C) => {
|
|
2066
2073
|
var H, oe;
|
|
2067
|
-
return
|
|
2074
|
+
return y(), M(ie, null, [!v.value && t.value === "hidden" ? (y(), I(n(Y), {
|
|
2068
2075
|
key: 0,
|
|
2069
2076
|
title: `绑定${a.label}`
|
|
2070
2077
|
}, {
|
|
2071
|
-
action: o(() => [
|
|
2078
|
+
action: o(() => [m(n(T), {
|
|
2072
2079
|
size: a.size,
|
|
2073
2080
|
type: "primary",
|
|
2074
2081
|
onClick: C[0] || (C[0] = (te) => F("bind"))
|
|
@@ -2078,11 +2085,11 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2078
2085
|
}, 8, ["size"])]),
|
|
2079
2086
|
default: o(() => [k(" 您还未绑定" + U(a.label) + "账号,请点击绑定。 ", 1)]),
|
|
2080
2087
|
_: 1
|
|
2081
|
-
}, 8, ["title"])) : E("", !0), v.value && t.value === "hidden" ? (
|
|
2088
|
+
}, 8, ["title"])) : E("", !0), v.value && t.value === "hidden" ? (y(), I(n(Y), {
|
|
2082
2089
|
key: 1,
|
|
2083
2090
|
title: `解绑${a.label}`
|
|
2084
2091
|
}, {
|
|
2085
|
-
action: o(() => [
|
|
2092
|
+
action: o(() => [m(n(T), {
|
|
2086
2093
|
size: a.size,
|
|
2087
2094
|
type: "primary",
|
|
2088
2095
|
onClick: C[1] || (C[1] = (te) => F("unbind"))
|
|
@@ -2090,22 +2097,22 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2090
2097
|
default: o(() => [k(" 解绑" + U(a.label), 1)]),
|
|
2091
2098
|
_: 1
|
|
2092
2099
|
}, 8, ["size"])]),
|
|
2093
|
-
default: o(() => [z("div", Vi, [
|
|
2100
|
+
default: o(() => [z("div", Vi, [p.value ? (y(), I(n(Ee), {
|
|
2094
2101
|
key: 0,
|
|
2095
2102
|
class: "oauth-binding-account__avatar",
|
|
2096
|
-
"image-url":
|
|
2103
|
+
"image-url": p.value,
|
|
2097
2104
|
size: 42
|
|
2098
|
-
}, null, 8, ["image-url"])) : (
|
|
2105
|
+
}, null, 8, ["image-url"])) : (y(), M("div", $i, [m(Ii, {
|
|
2099
2106
|
icon: S.value,
|
|
2100
2107
|
size: n(Si),
|
|
2101
2108
|
alt: a.label
|
|
2102
|
-
}, null, 8, ["icon", "size", "alt"])])), z("div", Ti, [z("div", Ui, U(a.label), 1), z("div",
|
|
2109
|
+
}, null, 8, ["icon", "size", "alt"])])), z("div", Ti, [z("div", Ui, U(a.label), 1), z("div", xi, U(r.value), 1)])])]),
|
|
2103
2110
|
_: 1
|
|
2104
|
-
}, 8, ["title"])) : E("", !0), q.value ? (
|
|
2111
|
+
}, 8, ["title"])) : E("", !0), q.value ? (y(), I(n(Y), {
|
|
2105
2112
|
key: 2,
|
|
2106
2113
|
title: `${N.value}前验证身份`
|
|
2107
2114
|
}, {
|
|
2108
|
-
action: o(() => [z("div",
|
|
2115
|
+
action: o(() => [z("div", Oi, [K.value ? (y(), I(n(T), {
|
|
2109
2116
|
key: 0,
|
|
2110
2117
|
size: a.size,
|
|
2111
2118
|
type: "primary",
|
|
@@ -2113,7 +2120,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2113
2120
|
}, {
|
|
2114
2121
|
default: o(() => [...C[4] || (C[4] = [k(" 邮箱验证 ", -1)])]),
|
|
2115
2122
|
_: 1
|
|
2116
|
-
}, 8, ["size"])) : E("", !0), j.value ? (
|
|
2123
|
+
}, 8, ["size"])) : E("", !0), j.value ? (y(), I(n(T), {
|
|
2117
2124
|
key: 1,
|
|
2118
2125
|
size: a.size,
|
|
2119
2126
|
type: "primary",
|
|
@@ -2124,16 +2131,16 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2124
2131
|
}, 8, ["size"])) : E("", !0)])]),
|
|
2125
2132
|
default: o(() => [C[6] || (C[6] = k(" 请选择一种已绑定的验证方式。 ", -1))]),
|
|
2126
2133
|
_: 1
|
|
2127
|
-
}, 8, ["title"])) : E("", !0), _.value ? (
|
|
2134
|
+
}, 8, ["title"])) : E("", !0), _.value ? (y(), I(ge, {
|
|
2128
2135
|
key: 3,
|
|
2129
2136
|
size: a.size,
|
|
2130
|
-
email: (H = n(
|
|
2131
|
-
onNext:
|
|
2132
|
-
}, null, 8, ["size", "email"])) : E("", !0), P.value ? (
|
|
2137
|
+
email: (H = n(u)) == null ? void 0 : H.email,
|
|
2138
|
+
onNext: O
|
|
2139
|
+
}, null, 8, ["size", "email"])) : E("", !0), P.value ? (y(), I(we, {
|
|
2133
2140
|
key: 4,
|
|
2134
2141
|
size: a.size,
|
|
2135
|
-
phone: ((oe = n(
|
|
2136
|
-
onNext:
|
|
2142
|
+
phone: ((oe = n(u)) == null ? void 0 : oe.phone) || "",
|
|
2143
|
+
onNext: O
|
|
2137
2144
|
}, null, 8, ["size", "phone"])) : E("", !0)], 64);
|
|
2138
2145
|
};
|
|
2139
2146
|
}
|
|
@@ -2161,35 +2168,35 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2161
2168
|
setup(e, {
|
|
2162
2169
|
emit: i
|
|
2163
2170
|
}) {
|
|
2164
|
-
const a = e,
|
|
2171
|
+
const a = e, u = i, {
|
|
2165
2172
|
userProfile: s,
|
|
2166
2173
|
clearUserProfile: d
|
|
2167
2174
|
} = ne(), {
|
|
2168
|
-
clearAuth:
|
|
2169
|
-
} =
|
|
2170
|
-
let
|
|
2175
|
+
clearAuth: l
|
|
2176
|
+
} = at(), t = A("check"), h = A(!1), g = A([]), f = A(!1), v = A(""), r = A(0);
|
|
2177
|
+
let p = null;
|
|
2171
2178
|
const S = A("email"), R = $(() => {
|
|
2172
2179
|
var C;
|
|
2173
|
-
const
|
|
2174
|
-
if (!
|
|
2175
|
-
const [b, c] =
|
|
2176
|
-
return b.length <= 2 ?
|
|
2180
|
+
const O = ((C = s.value) == null ? void 0 : C.email) || "";
|
|
2181
|
+
if (!O) return "";
|
|
2182
|
+
const [b, c] = O.split("@");
|
|
2183
|
+
return b.length <= 2 ? O : `${b.slice(0, 2)}***@${c}`;
|
|
2177
2184
|
}), B = $(() => {
|
|
2178
2185
|
var b;
|
|
2179
|
-
const
|
|
2180
|
-
return
|
|
2186
|
+
const O = ((b = s.value) == null ? void 0 : b.phone) || "";
|
|
2187
|
+
return O.length < 7 ? O : `${O.slice(0, 3)}****${O.slice(-4)}`;
|
|
2181
2188
|
}), K = $(() => S.value === "email" ? `为确保账号安全,我们将向您的邮箱 ${R.value} 发送验证码` : `为确保账号安全,我们将向您的手机号 ${B.value} 发送验证码`), j = $(() => S.value === "email" ? `验证码已发送至 ${R.value},注销后该账号将无法继续登录,请谨慎操作` : `验证码已发送至 ${B.value},注销后该账号将无法继续登录,请谨慎操作`), V = A(), w = A({
|
|
2182
2189
|
userToken: "",
|
|
2183
2190
|
code: "",
|
|
2184
2191
|
password: "",
|
|
2185
2192
|
confirmText: ""
|
|
2186
2193
|
}), q = A(!1);
|
|
2187
|
-
function _(
|
|
2188
|
-
|
|
2194
|
+
function _(O, b) {
|
|
2195
|
+
O !== "注销" ? b('请输入"注销"以确认操作') : b();
|
|
2189
2196
|
}
|
|
2190
2197
|
async function P() {
|
|
2191
|
-
var
|
|
2192
|
-
if (
|
|
2198
|
+
var O, b;
|
|
2199
|
+
if (h.value = !0, h.value = !1, !((O = s.value) != null && O.email) && !((b = s.value) != null && b.phone)) {
|
|
2193
2200
|
G.error("请先绑定邮箱或手机号后再注销账号");
|
|
2194
2201
|
return;
|
|
2195
2202
|
}
|
|
@@ -2199,8 +2206,8 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2199
2206
|
}
|
|
2200
2207
|
S.value = s.value.email ? "email" : "phone", t.value = "sendCode";
|
|
2201
2208
|
}
|
|
2202
|
-
function N(
|
|
2203
|
-
S.value =
|
|
2209
|
+
function N(O) {
|
|
2210
|
+
S.value = O, t.value = "sendCode";
|
|
2204
2211
|
}
|
|
2205
2212
|
async function F() {
|
|
2206
2213
|
var c, C;
|
|
@@ -2210,7 +2217,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2210
2217
|
return;
|
|
2211
2218
|
}
|
|
2212
2219
|
f.value = !0;
|
|
2213
|
-
const H = await
|
|
2220
|
+
const H = await x().auth.verify.email.retry.post({
|
|
2214
2221
|
email: s.value.email,
|
|
2215
2222
|
purpose: "deleteAccount"
|
|
2216
2223
|
});
|
|
@@ -2224,21 +2231,21 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2224
2231
|
return;
|
|
2225
2232
|
}
|
|
2226
2233
|
f.value = !0;
|
|
2227
|
-
const
|
|
2234
|
+
const O = await x().auth.verify.sms.send.post({
|
|
2228
2235
|
phone: s.value.phone,
|
|
2229
2236
|
purpose: "deleteAccount"
|
|
2230
2237
|
});
|
|
2231
2238
|
f.value = !1;
|
|
2232
|
-
const b = ke(
|
|
2233
|
-
|
|
2239
|
+
const b = ke(O);
|
|
2240
|
+
O.error || (G.success("验证码已发送"), t.value = "confirm"), D(b);
|
|
2234
2241
|
}
|
|
2235
|
-
function D(
|
|
2236
|
-
!
|
|
2237
|
-
r.value--, r.value <= 0 &&
|
|
2242
|
+
function D(O) {
|
|
2243
|
+
!O || O <= 0 || (r.value = Math.ceil(O), p && clearInterval(p), p = setInterval(() => {
|
|
2244
|
+
r.value--, r.value <= 0 && p && (clearInterval(p), p = null);
|
|
2238
2245
|
}, 1e3));
|
|
2239
2246
|
}
|
|
2240
2247
|
Ae(() => {
|
|
2241
|
-
|
|
2248
|
+
p && (clearInterval(p), p = null);
|
|
2242
2249
|
});
|
|
2243
2250
|
async function Z() {
|
|
2244
2251
|
var C, H;
|
|
@@ -2258,61 +2265,61 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2258
2265
|
confirmText: w.value.confirmText
|
|
2259
2266
|
}, {
|
|
2260
2267
|
error: c
|
|
2261
|
-
} = await
|
|
2262
|
-
q.value = !1, c || (t.value = "success", d(),
|
|
2268
|
+
} = await x().auth.users.deleteAccount.post(b);
|
|
2269
|
+
q.value = !1, c || (t.value = "success", d(), l(), u("deleted"));
|
|
2263
2270
|
}
|
|
2264
2271
|
function ae() {
|
|
2265
2272
|
window.location.href = "/";
|
|
2266
2273
|
}
|
|
2267
|
-
return (
|
|
2274
|
+
return (O, b) => t.value === "check" ? (y(), I(n(Y), {
|
|
2268
2275
|
key: 0,
|
|
2269
2276
|
type: "warning",
|
|
2270
2277
|
title: "注销账号"
|
|
2271
2278
|
}, {
|
|
2272
|
-
action: o(() => [
|
|
2279
|
+
action: o(() => [m(n(T), {
|
|
2273
2280
|
size: a.size,
|
|
2274
2281
|
type: "primary",
|
|
2275
2282
|
status: "danger",
|
|
2276
|
-
loading:
|
|
2283
|
+
loading: h.value,
|
|
2277
2284
|
onClick: P
|
|
2278
2285
|
}, {
|
|
2279
|
-
default: o(() => [k(U(
|
|
2286
|
+
default: o(() => [k(U(h.value ? "检查中..." : "开始注销"), 1)]),
|
|
2280
2287
|
_: 1
|
|
2281
2288
|
}, 8, ["size", "loading"])]),
|
|
2282
2289
|
default: o(() => [b[10] || (b[10] = k(" 注销账号后,登录凭据、第三方绑定和当前登录态会被清除;历史订单、用量、审计等业务记录会保留用于对账和安全追溯。 ", -1))]),
|
|
2283
2290
|
_: 1
|
|
2284
|
-
})) : t.value === "dependencies" ? (
|
|
2291
|
+
})) : t.value === "dependencies" ? (y(), M(ie, {
|
|
2285
2292
|
key: 1
|
|
2286
|
-
}, [
|
|
2293
|
+
}, [m(n(Y), {
|
|
2287
2294
|
type: "error",
|
|
2288
2295
|
title: "无法注销账号"
|
|
2289
2296
|
}, {
|
|
2290
2297
|
default: o(() => [...b[11] || (b[11] = [k(" 您的账号下还有以下资源,请先处理后再注销: ", -1)])]),
|
|
2291
2298
|
_: 1
|
|
2292
|
-
}), z("div", Bi, [(
|
|
2299
|
+
}), z("div", Bi, [(y(!0), M(ie, null, Fe(g.value, (c) => (y(), M("div", {
|
|
2293
2300
|
key: c.type,
|
|
2294
2301
|
class: "dependency-item"
|
|
2295
|
-
}, [z("span", qi, U(c.label), 1), z("span", Li, U(c.count) + " 个", 1)]))), 128))]), z("div", Mi, [
|
|
2302
|
+
}, [z("span", qi, U(c.label), 1), z("span", Li, U(c.count) + " 个", 1)]))), 128))]), z("div", Mi, [m(n(T), {
|
|
2296
2303
|
size: a.size,
|
|
2297
2304
|
onClick: b[0] || (b[0] = (c) => t.value = "check")
|
|
2298
2305
|
}, {
|
|
2299
2306
|
default: o(() => [...b[12] || (b[12] = [k("返回", -1)])]),
|
|
2300
2307
|
_: 1
|
|
2301
|
-
}, 8, ["size"])])], 64)) : t.value === "chooseMethod" ? (
|
|
2308
|
+
}, 8, ["size"])])], 64)) : t.value === "chooseMethod" ? (y(), I(n(Y), {
|
|
2302
2309
|
key: 2,
|
|
2303
2310
|
type: "normal",
|
|
2304
2311
|
title: "选择验证方式"
|
|
2305
2312
|
}, {
|
|
2306
|
-
action: o(() => [
|
|
2313
|
+
action: o(() => [m(n(me), null, {
|
|
2307
2314
|
default: o(() => {
|
|
2308
2315
|
var c, C;
|
|
2309
|
-
return [
|
|
2316
|
+
return [m(n(T), {
|
|
2310
2317
|
size: a.size,
|
|
2311
2318
|
onClick: b[1] || (b[1] = (H) => t.value = "check")
|
|
2312
2319
|
}, {
|
|
2313
2320
|
default: o(() => [...b[13] || (b[13] = [k("取消", -1)])]),
|
|
2314
2321
|
_: 1
|
|
2315
|
-
}, 8, ["size"]), (c = n(s)) != null && c.email ? (
|
|
2322
|
+
}, 8, ["size"]), (c = n(s)) != null && c.email ? (y(), I(n(T), {
|
|
2316
2323
|
key: 0,
|
|
2317
2324
|
size: a.size,
|
|
2318
2325
|
type: "primary",
|
|
@@ -2320,7 +2327,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2320
2327
|
}, {
|
|
2321
2328
|
default: o(() => [...b[14] || (b[14] = [k(" 邮箱验证 ", -1)])]),
|
|
2322
2329
|
_: 1
|
|
2323
|
-
}, 8, ["size"])) : E("", !0), (C = n(s)) != null && C.phone ? (
|
|
2330
|
+
}, 8, ["size"])) : E("", !0), (C = n(s)) != null && C.phone ? (y(), I(n(T), {
|
|
2324
2331
|
key: 1,
|
|
2325
2332
|
size: a.size,
|
|
2326
2333
|
type: "primary",
|
|
@@ -2334,19 +2341,19 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2334
2341
|
})]),
|
|
2335
2342
|
default: o(() => [b[16] || (b[16] = k(" 请选择一种已绑定的身份验证方式。 ", -1))]),
|
|
2336
2343
|
_: 1
|
|
2337
|
-
})) : t.value === "sendCode" ? (
|
|
2344
|
+
})) : t.value === "sendCode" ? (y(), I(n(Y), {
|
|
2338
2345
|
key: 3,
|
|
2339
2346
|
type: "normal",
|
|
2340
2347
|
title: "身份验证"
|
|
2341
2348
|
}, {
|
|
2342
|
-
action: o(() => [
|
|
2343
|
-
default: o(() => [
|
|
2349
|
+
action: o(() => [m(n(me), null, {
|
|
2350
|
+
default: o(() => [m(n(T), {
|
|
2344
2351
|
size: a.size,
|
|
2345
2352
|
onClick: b[4] || (b[4] = (c) => t.value = "check")
|
|
2346
2353
|
}, {
|
|
2347
2354
|
default: o(() => [...b[17] || (b[17] = [k("取消", -1)])]),
|
|
2348
2355
|
_: 1
|
|
2349
|
-
}, 8, ["size"]),
|
|
2356
|
+
}, 8, ["size"]), m(n(T), {
|
|
2350
2357
|
size: a.size,
|
|
2351
2358
|
type: "primary",
|
|
2352
2359
|
loading: f.value,
|
|
@@ -2359,15 +2366,15 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2359
2366
|
})]),
|
|
2360
2367
|
default: o(() => [k(U(K.value) + " ", 1)]),
|
|
2361
2368
|
_: 1
|
|
2362
|
-
})) : t.value === "confirm" ? (
|
|
2369
|
+
})) : t.value === "confirm" ? (y(), M(ie, {
|
|
2363
2370
|
key: 4
|
|
2364
|
-
}, [
|
|
2371
|
+
}, [m(n(Y), {
|
|
2365
2372
|
type: "warning",
|
|
2366
2373
|
title: "确认注销"
|
|
2367
2374
|
}, {
|
|
2368
2375
|
default: o(() => [k(U(j.value), 1)]),
|
|
2369
2376
|
_: 1
|
|
2370
|
-
}),
|
|
2377
|
+
}), m(n(le), {
|
|
2371
2378
|
ref_key: "formRef",
|
|
2372
2379
|
ref: V,
|
|
2373
2380
|
model: w.value,
|
|
@@ -2377,7 +2384,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2377
2384
|
}, {
|
|
2378
2385
|
default: o(() => {
|
|
2379
2386
|
var c;
|
|
2380
|
-
return [S.value === "email" ? (
|
|
2387
|
+
return [S.value === "email" ? (y(), I(n(L), {
|
|
2381
2388
|
key: 0,
|
|
2382
2389
|
field: "userToken",
|
|
2383
2390
|
label: "邮箱验证码",
|
|
@@ -2386,13 +2393,13 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2386
2393
|
message: "请输入验证码"
|
|
2387
2394
|
}]
|
|
2388
2395
|
}, {
|
|
2389
|
-
default: o(() => [z("div", Ki, [
|
|
2396
|
+
default: o(() => [z("div", Ki, [m(n(Q), {
|
|
2390
2397
|
modelValue: w.value.userToken,
|
|
2391
2398
|
"onUpdate:modelValue": b[5] || (b[5] = (C) => w.value.userToken = C),
|
|
2392
2399
|
placeholder: "请输入6位验证码",
|
|
2393
2400
|
"max-length": 6,
|
|
2394
2401
|
"allow-clear": ""
|
|
2395
|
-
}, null, 8, ["modelValue"]),
|
|
2402
|
+
}, null, 8, ["modelValue"]), m(n(T), {
|
|
2396
2403
|
disabled: r.value > 0,
|
|
2397
2404
|
loading: f.value,
|
|
2398
2405
|
onClick: F
|
|
@@ -2401,7 +2408,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2401
2408
|
_: 1
|
|
2402
2409
|
}, 8, ["disabled", "loading"])])]),
|
|
2403
2410
|
_: 1
|
|
2404
|
-
})) : (
|
|
2411
|
+
})) : (y(), I(n(L), {
|
|
2405
2412
|
key: 1,
|
|
2406
2413
|
field: "code",
|
|
2407
2414
|
label: "短信验证码",
|
|
@@ -2410,12 +2417,12 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2410
2417
|
message: "请输入验证码"
|
|
2411
2418
|
}]
|
|
2412
2419
|
}, {
|
|
2413
|
-
default: o(() => [z("div", Fi, [
|
|
2420
|
+
default: o(() => [z("div", Fi, [m(n(Q), {
|
|
2414
2421
|
modelValue: w.value.code,
|
|
2415
2422
|
"onUpdate:modelValue": b[6] || (b[6] = (C) => w.value.code = C),
|
|
2416
2423
|
placeholder: "请输入验证码",
|
|
2417
2424
|
"allow-clear": ""
|
|
2418
|
-
}, null, 8, ["modelValue"]),
|
|
2425
|
+
}, null, 8, ["modelValue"]), m(n(T), {
|
|
2419
2426
|
disabled: r.value > 0,
|
|
2420
2427
|
loading: f.value,
|
|
2421
2428
|
onClick: F
|
|
@@ -2424,7 +2431,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2424
2431
|
_: 1
|
|
2425
2432
|
}, 8, ["disabled", "loading"])])]),
|
|
2426
2433
|
_: 1
|
|
2427
|
-
})), (c = n(s)) != null && c.hasPassword ? (
|
|
2434
|
+
})), (c = n(s)) != null && c.hasPassword ? (y(), I(n(L), {
|
|
2428
2435
|
key: 2,
|
|
2429
2436
|
field: "password",
|
|
2430
2437
|
label: "登录密码",
|
|
@@ -2433,14 +2440,14 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2433
2440
|
message: "请输入密码"
|
|
2434
2441
|
}]
|
|
2435
2442
|
}, {
|
|
2436
|
-
default: o(() => [
|
|
2443
|
+
default: o(() => [m(n(Ge), {
|
|
2437
2444
|
modelValue: w.value.password,
|
|
2438
2445
|
"onUpdate:modelValue": b[7] || (b[7] = (C) => w.value.password = C),
|
|
2439
2446
|
placeholder: "请输入您的登录密码",
|
|
2440
2447
|
"allow-clear": ""
|
|
2441
2448
|
}, null, 8, ["modelValue"])]),
|
|
2442
2449
|
_: 1
|
|
2443
|
-
})) : E("", !0),
|
|
2450
|
+
})) : E("", !0), m(n(L), {
|
|
2444
2451
|
field: "confirmText",
|
|
2445
2452
|
label: "请输入「注销」以确认",
|
|
2446
2453
|
rules: [{
|
|
@@ -2450,21 +2457,21 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2450
2457
|
validator: _
|
|
2451
2458
|
}]
|
|
2452
2459
|
}, {
|
|
2453
|
-
default: o(() => [
|
|
2460
|
+
default: o(() => [m(n(Q), {
|
|
2454
2461
|
modelValue: w.value.confirmText,
|
|
2455
2462
|
"onUpdate:modelValue": b[8] || (b[8] = (C) => w.value.confirmText = C),
|
|
2456
2463
|
placeholder: "注销",
|
|
2457
2464
|
"allow-clear": ""
|
|
2458
2465
|
}, null, 8, ["modelValue"])]),
|
|
2459
2466
|
_: 1
|
|
2460
|
-
}, 8, ["rules"]),
|
|
2461
|
-
default: o(() => [
|
|
2462
|
-
default: o(() => [
|
|
2467
|
+
}, 8, ["rules"]), m(n(L), null, {
|
|
2468
|
+
default: o(() => [m(n(me), null, {
|
|
2469
|
+
default: o(() => [m(n(T), {
|
|
2463
2470
|
onClick: b[9] || (b[9] = (C) => t.value = "check")
|
|
2464
2471
|
}, {
|
|
2465
2472
|
default: o(() => [...b[18] || (b[18] = [k("取消", -1)])]),
|
|
2466
2473
|
_: 1
|
|
2467
|
-
}),
|
|
2474
|
+
}), m(n(T), {
|
|
2468
2475
|
type: "primary",
|
|
2469
2476
|
status: "danger",
|
|
2470
2477
|
loading: q.value,
|
|
@@ -2479,13 +2486,13 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2479
2486
|
})];
|
|
2480
2487
|
}),
|
|
2481
2488
|
_: 1
|
|
2482
|
-
}, 8, ["model", "size"])], 64)) : t.value === "success" ? (
|
|
2489
|
+
}, 8, ["model", "size"])], 64)) : t.value === "success" ? (y(), I(n(Ye), {
|
|
2483
2490
|
key: 5,
|
|
2484
2491
|
status: "success",
|
|
2485
2492
|
title: "账号已注销"
|
|
2486
2493
|
}, {
|
|
2487
2494
|
subtitle: o(() => [...b[19] || (b[19] = [k(" 您的账号已成功注销,登录凭据和绑定身份已清除 ", -1)])]),
|
|
2488
|
-
extra: o(() => [
|
|
2495
|
+
extra: o(() => [m(n(T), {
|
|
2489
2496
|
type: "primary",
|
|
2490
2497
|
onClick: ae
|
|
2491
2498
|
}, {
|
|
@@ -2508,14 +2515,14 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2508
2515
|
expose: i,
|
|
2509
2516
|
emit: a
|
|
2510
2517
|
}) {
|
|
2511
|
-
const
|
|
2518
|
+
const u = a;
|
|
2512
2519
|
function s() {
|
|
2513
|
-
w.value = !1, t.value = ["PersonalInformation"],
|
|
2520
|
+
w.value = !1, t.value = ["PersonalInformation"], u("cancel");
|
|
2514
2521
|
}
|
|
2515
2522
|
function d() {
|
|
2516
2523
|
s();
|
|
2517
2524
|
}
|
|
2518
|
-
const
|
|
2525
|
+
const l = A("large"), t = A(["PersonalInformation"]), h = [{
|
|
2519
2526
|
provider: "github",
|
|
2520
2527
|
name: pe.github,
|
|
2521
2528
|
meta: {
|
|
@@ -2550,7 +2557,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2550
2557
|
}), r = $(() => {
|
|
2551
2558
|
const _ = g.value.authMethods;
|
|
2552
2559
|
return _.login.emailPassword || _.login.phonePassword;
|
|
2553
|
-
}),
|
|
2560
|
+
}), p = $(() => r.value || f.value || v.value), S = $(() => g.value.authMethods.login.passkey), R = $(() => h.filter((_) => {
|
|
2554
2561
|
var P, N;
|
|
2555
2562
|
return (N = (P = g.value.oauth) == null ? void 0 : P[_.provider]) == null ? void 0 : N.enabled;
|
|
2556
2563
|
}).map((_) => ({
|
|
@@ -2570,7 +2577,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2570
2577
|
meta: {
|
|
2571
2578
|
icon: "mingcute:phone-fill"
|
|
2572
2579
|
}
|
|
2573
|
-
}),
|
|
2580
|
+
}), p.value && _.push({
|
|
2574
2581
|
name: "登录密码",
|
|
2575
2582
|
path: "SetPassword",
|
|
2576
2583
|
meta: {
|
|
@@ -2620,7 +2627,7 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2620
2627
|
const {
|
|
2621
2628
|
changeType: V,
|
|
2622
2629
|
show: w
|
|
2623
|
-
} =
|
|
2630
|
+
} = ot(u);
|
|
2624
2631
|
Ie(R, (_) => {
|
|
2625
2632
|
t.value[0].startsWith("OAuthBinding:") && !_.some((P) => P.path === t.value[0]) && (t.value = ["PersonalInformation"]);
|
|
2626
2633
|
}), Ie(B, (_) => {
|
|
@@ -2635,44 +2642,44 @@ const zi = ["src", "alt", "width", "height"], Pi = /* @__PURE__ */ J({
|
|
|
2635
2642
|
}
|
|
2636
2643
|
return i({
|
|
2637
2644
|
setData: q
|
|
2638
|
-
}), (_, P) => n(w) ? (
|
|
2645
|
+
}), (_, P) => n(w) ? (y(), I(n(Je), {
|
|
2639
2646
|
key: 0,
|
|
2640
2647
|
visible: !0,
|
|
2641
2648
|
"body-class": "AppSettingbodyClass",
|
|
2642
2649
|
"mask-closable": !1,
|
|
2643
2650
|
footer: !1,
|
|
2644
|
-
width: n(
|
|
2651
|
+
width: n(qe),
|
|
2645
2652
|
onCancel: s
|
|
2646
2653
|
}, {
|
|
2647
2654
|
title: o(() => [...P[1] || (P[1] = [k(" 用户信息 ", -1)])]),
|
|
2648
|
-
default: o(() => [z("div", Gi, [z("div", Yi, [
|
|
2655
|
+
default: o(() => [z("div", Gi, [z("div", Yi, [m(nt, {
|
|
2649
2656
|
"selected-keys": t.value,
|
|
2650
2657
|
"onUpdate:selectedKeys": P[0] || (P[0] = (N) => t.value = N),
|
|
2651
2658
|
menus: B.value,
|
|
2652
2659
|
onChange: j
|
|
2653
|
-
}, null, 8, ["selected-keys", "menus"])]), z("div", Ji, [t.value[0] === "PersonalInformation" ? (
|
|
2660
|
+
}, null, 8, ["selected-keys", "menus"])]), z("div", Ji, [t.value[0] === "PersonalInformation" ? (y(), I(_t, {
|
|
2654
2661
|
key: 0,
|
|
2655
|
-
size:
|
|
2656
|
-
}, null, 8, ["size"])) : E("", !0), t.value[0] === "EmailBinding" ? (
|
|
2662
|
+
size: l.value
|
|
2663
|
+
}, null, 8, ["size"])) : E("", !0), t.value[0] === "EmailBinding" ? (y(), I(ni, {
|
|
2657
2664
|
key: 1,
|
|
2658
|
-
size:
|
|
2659
|
-
}, null, 8, ["size"])) : E("", !0), t.value[0] === "PhoneBinding" ? (
|
|
2665
|
+
size: l.value
|
|
2666
|
+
}, null, 8, ["size"])) : E("", !0), t.value[0] === "PhoneBinding" ? (y(), I(mi, {
|
|
2660
2667
|
key: 2,
|
|
2661
|
-
size:
|
|
2662
|
-
}, null, 8, ["size"])) : E("", !0), t.value[0] === "SetPassword" ? (
|
|
2668
|
+
size: l.value
|
|
2669
|
+
}, null, 8, ["size"])) : E("", !0), t.value[0] === "SetPassword" ? (y(), I(Tt, {
|
|
2663
2670
|
key: 3,
|
|
2664
|
-
size:
|
|
2665
|
-
}, null, 8, ["size"])) : E("", !0), t.value[0] === "PasskeyBinding" ? (
|
|
2671
|
+
size: l.value
|
|
2672
|
+
}, null, 8, ["size"])) : E("", !0), t.value[0] === "PasskeyBinding" ? (y(), I(Jt, {
|
|
2666
2673
|
key: 4,
|
|
2667
|
-
size:
|
|
2668
|
-
}, null, 8, ["size"])) : E("", !0), K.value ? (
|
|
2674
|
+
size: l.value
|
|
2675
|
+
}, null, 8, ["size"])) : E("", !0), K.value ? (y(), I(Di, {
|
|
2669
2676
|
key: K.value.provider,
|
|
2670
2677
|
provider: K.value.provider,
|
|
2671
2678
|
label: K.value.name,
|
|
2672
|
-
size:
|
|
2673
|
-
}, null, 8, ["provider", "label", "size"])) : E("", !0), t.value[0] === "AccountDelete" ? (
|
|
2679
|
+
size: l.value
|
|
2680
|
+
}, null, 8, ["provider", "label", "size"])) : E("", !0), t.value[0] === "AccountDelete" ? (y(), I(Wi, {
|
|
2674
2681
|
key: 6,
|
|
2675
|
-
size:
|
|
2682
|
+
size: l.value,
|
|
2676
2683
|
onDeleted: d
|
|
2677
2684
|
}, null, 8, ["size"])) : E("", !0)])])]),
|
|
2678
2685
|
_: 1
|
|
@@ -2688,26 +2695,25 @@ export {
|
|
|
2688
2695
|
ni as _,
|
|
2689
2696
|
pi as a,
|
|
2690
2697
|
ge as b,
|
|
2691
|
-
|
|
2692
|
-
|
|
2698
|
+
$t as c,
|
|
2699
|
+
_t as d,
|
|
2693
2700
|
mi as e,
|
|
2694
2701
|
we as f,
|
|
2695
|
-
|
|
2702
|
+
Tt as g,
|
|
2696
2703
|
bn as h,
|
|
2697
2704
|
Ai as i,
|
|
2698
2705
|
Ri as j,
|
|
2699
2706
|
_n as k,
|
|
2700
2707
|
Ii as l,
|
|
2701
|
-
|
|
2702
|
-
|
|
2708
|
+
kn as m,
|
|
2709
|
+
re as n,
|
|
2703
2710
|
Ci as o,
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2711
|
+
se as p,
|
|
2712
|
+
ye as q,
|
|
2713
|
+
vi as r,
|
|
2714
|
+
hi as s,
|
|
2715
|
+
gn as t,
|
|
2709
2716
|
Ft as u,
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
Si as x
|
|
2717
|
+
wn as v,
|
|
2718
|
+
Si as w
|
|
2713
2719
|
};
|