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