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