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