@huyooo/ui 0.11.0 → 0.11.2

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.
Files changed (68) hide show
  1. package/dist/AuthkitAppSetting-BCrLMpLg.js +1322 -0
  2. package/dist/AuthkitSignInPhone-DmCQ2fWs.js +1721 -0
  3. package/dist/{Clipboard-CK_nROjb.js → Clipboard---tG2Zxz.js} +1 -1
  4. package/dist/{Contact-CpHU1bJ7.js → Contact-BEUbBGiB.js} +2 -2
  5. package/dist/{CustomTable-1W5byjgJ.js → CustomTable-CVZ4mFzi.js} +2 -3
  6. package/dist/FeedbackItem-CN041vTm.js +495 -0
  7. package/dist/FeedbackModal-aI28o-w5.js +1053 -0
  8. package/dist/MessageHandle-BV1nKlxs.js +1147 -0
  9. package/dist/MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-F6neJUg3.js +142 -0
  10. package/dist/{PaySubscriptions-C4Een__-.js → PaySubscriptions-B3gI1Eme.js} +5 -6
  11. package/dist/{ReferrerReferees-DIassvGO.js → ReferrerReferees-DJzPo7X5.js} +7 -7
  12. package/dist/{Upload.vue_vue_type_script_setup_true_lang-DA8VZBrl.js → Upload.vue_vue_type_script_setup_true_lang-D_-oMTOo.js} +1 -1
  13. package/dist/UserAccountMenu-CJ9KKVYa.js +371 -0
  14. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-ClAXNSgl.js +81 -0
  15. package/dist/{WidthContainer-TXsvW1ut.js → WidthContainer-BG10rumn.js} +248 -252
  16. package/dist/{apiClients-ANEApCyY.js → apiClients-9b4zNZ2S.js} +2 -2
  17. package/dist/authkit.js +41 -40
  18. package/dist/common.js +2 -2
  19. package/dist/components/Authkit/AuthkitAppSetting.vue.d.ts +1 -1
  20. package/dist/components/Referrer/ReferrerReferees.vue.d.ts +1 -1
  21. package/dist/components/{User → UserMenu}/UserAccountMenu.vue.d.ts +1 -5
  22. package/dist/components/{User/UserPanel.vue.d.ts → UserMenu/UserMenu.vue.d.ts} +5 -12
  23. package/dist/components/UserMenu/UserMenuDivider.vue.d.ts +2 -0
  24. package/dist/components/UserMenu/UserMenuHeader.vue.d.ts +13 -0
  25. package/dist/components/{User/UserPanelItem.vue.d.ts → UserMenu/UserMenuItem.vue.d.ts} +6 -10
  26. package/dist/components/UserMenu/UserMenuModals.vue.d.ts +137 -0
  27. package/dist/components/UserMenu/items/UserMenuFeedbackItem.vue.d.ts +2 -0
  28. package/dist/components/UserMenu/items/UserMenuInvitationsItem.vue.d.ts +2 -0
  29. package/dist/components/UserMenu/items/UserMenuMessageItem.vue.d.ts +2 -0
  30. package/dist/components/UserMenu/items/UserMenuSettingItem.vue.d.ts +2 -0
  31. package/dist/components/UserMenu/items/UserMenuSubscriptionItem.vue.d.ts +2 -0
  32. package/dist/components/UserMenu/parts/UserAvatar.vue.d.ts +9 -0
  33. package/dist/components/UserMenu/parts/UserBasicInformation.vue.d.ts +13 -0
  34. package/dist/components/UserMenu/parts/UserSubscriptionBaseInformation.vue.d.ts +15 -0
  35. package/dist/composables/UserMenu/useUserMenu.d.ts +20 -0
  36. package/dist/composables.d.ts +1 -0
  37. package/dist/composables.js +19 -17
  38. package/dist/feedback.js +16 -15
  39. package/dist/main.js +193 -180
  40. package/dist/message.js +10 -9
  41. package/dist/pay.js +1 -1
  42. package/dist/privateCom.js +1 -1
  43. package/dist/referrer.js +1 -1
  44. package/dist/style.css +1 -1
  45. package/dist/upload.js +2 -2
  46. package/dist/{useAuthkitAppsAuthPageInfo-Da2yJTT-.js → useAuthkitAppsAuthPageInfo-494yLvsu.js} +1 -1
  47. package/dist/{useAuthkitCreateAndUpdate-BLs5vQOu.js → useAuthkitCreateAndUpdate-DyRtFxZS.js} +1 -1
  48. package/dist/{useAuthkitUsersProfile-Cx8NXjlt.js → useAuthkitUsersProfile-lGlQP54m.js} +1 -1
  49. package/dist/{useDownloads-DT5W2af6.js → useDownloads-DaeIY0E9.js} +1 -1
  50. package/dist/{useLegalLinks-BIF45kUt.js → useLegalLinks-CPbWqlu6.js} +2 -2
  51. package/dist/{useMessageNotifications-CavBmgO7.js → useMessageNotifications-Dg5q-C_o.js} +1 -1
  52. package/dist/{useSEO-MPXQf0dn.js → useSEO-CXX9dcBx.js} +2 -2
  53. package/dist/{useTableHandle--NSbZ-57.js → useTableHandle-Cjq4gcC0.js} +1 -1
  54. package/dist/{cos-js-sdk-v5-BJ5AlBRu.js → useUploadCos-DiJmmbRf.js} +2469 -2232
  55. package/dist/useUserMenu-B3HKZKJ4.js +43 -0
  56. package/dist/user.d.ts +15 -7
  57. package/dist/user.js +17 -9
  58. package/package.json +1 -1
  59. package/dist/AuthkitSignInPhone-BWPCpUie.js +0 -3034
  60. package/dist/FeedbackModal-qAJLL3V3.js +0 -1535
  61. package/dist/MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-D109kT8_.js +0 -1282
  62. package/dist/UserAccountMenu-BIRTtjLb.js +0 -266
  63. package/dist/UserSubscriptionBaseInformation-BUs3qiHd.js +0 -60
  64. package/dist/components/User/UserAvatar.vue.d.ts +0 -23
  65. package/dist/components/User/UserBasicInformation.vue.d.ts +0 -41
  66. package/dist/components/User/UserSubscriptionBaseInformation.vue.d.ts +0 -32
  67. package/dist/useUploadCos-D6y0INvP.js +0 -242
  68. /package/dist/components/{User/UserButton.vue.d.ts → UserMenu/parts/UserSignInButton.vue.d.ts} +0 -0
@@ -1,3034 +0,0 @@
1
- /* empty css */
2
- /* empty css */
3
- /* empty css */
4
- import { defineComponent as $, computed as O, openBlock as g, createElementBlock as V, normalizeStyle as Z, normalizeClass as ke, createElementVNode as h, ref as w, createBlock as k, unref as e, withCtx as s, createVNode as i, createTextVNode as b, onMounted as W, onUnmounted as ue, withDirectives as Se, toDisplayString as T, vShow as ze, Fragment as j, createCommentVNode as I, renderList as Ie, isRef as Ve, useSlots as pe, renderSlot as ee } from "vue";
5
- import { Form as D, FormItem as z, Avatar as K, Input as P, Textarea as $e, Button as U, Message as H, Alert as N, Space as se, InputPassword as Ae, Result as Pe, Modal as ve, Divider as Ce, Link as M, List as Ue, ListItem as le, ListItemMeta as oe } from "@arco-design/web-vue";
6
- /* empty css */
7
- import { e as R, g as J, i as ge, u as qe } from "./apiClients-ANEApCyY.js";
8
- /* empty css */
9
- /* empty css */
10
- import { u as Re } from "./useUploadCos-D6y0INvP.js";
11
- import { _ as xe, g as Te, i as Be } from "./plugin-vue_export-helper-LjDO2Zua.js";
12
- import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
- import { a as Q, u as X } from "./useAuthkitUsersProfile-Cx8NXjlt.js";
14
- import { M as Le } from "./Menu-Cy2ZPeaz.js";
15
- import { u as Oe } from "./useAuthkitCreateAndUpdate-BLs5vQOu.js";
16
- import { u as de } from "./useAuthkitAppsAuthPageInfo-Da2yJTT-.js";
17
- /* empty css */
18
- import { Icon as Fe } from "@iconify/vue";
19
- import { u as Ee } from "./useLegalLinks-BIF45kUt.js";
20
- /* empty css */
21
- /* empty css */
22
- /* empty css */
23
- /* empty css */
24
- const De = $({
25
- name: "IconCamera",
26
- props: {
27
- size: {
28
- type: [Number, String]
29
- },
30
- strokeWidth: {
31
- type: Number,
32
- default: 4
33
- },
34
- strokeLinecap: {
35
- type: String,
36
- default: "butt",
37
- validator: (p) => ["butt", "round", "square"].includes(p)
38
- },
39
- strokeLinejoin: {
40
- type: String,
41
- default: "miter",
42
- validator: (p) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(p)
43
- },
44
- rotate: Number,
45
- spin: Boolean
46
- },
47
- emits: {
48
- click: (p) => !0
49
- },
50
- setup(p, {
51
- emit: m
52
- }) {
53
- const n = Te("icon"), l = O(() => [n, `${n}-camera`, {
54
- [`${n}-spin`]: p.spin
55
- }]), r = O(() => {
56
- const a = {};
57
- return p.size && (a.fontSize = Be(p.size) ? `${p.size}px` : p.size), p.rotate && (a.transform = `rotate(${p.rotate}deg)`), a;
58
- });
59
- return {
60
- cls: l,
61
- innerStyle: r,
62
- onClick: (a) => {
63
- m("click", a);
64
- }
65
- };
66
- }
67
- }), Ne = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
68
- function He(p, m, n, l, r, d) {
69
- return g(), V("svg", {
70
- viewBox: "0 0 48 48",
71
- fill: "none",
72
- xmlns: "http://www.w3.org/2000/svg",
73
- stroke: "currentColor",
74
- class: ke(p.cls),
75
- style: Z(p.innerStyle),
76
- "stroke-width": p.strokeWidth,
77
- "stroke-linecap": p.strokeLinecap,
78
- "stroke-linejoin": p.strokeLinejoin,
79
- onClick: m[0] || (m[0] = (...a) => p.onClick && p.onClick(...a))
80
- }, m[1] || (m[1] = [h("path", {
81
- d: "m33 12-1.862-3.724A.5.5 0 0 0 30.691 8H17.309a.5.5 0 0 0-.447.276L15 12m16 14a7 7 0 1 1-14 0 7 7 0 0 1 14 0ZM7 40h34a1 1 0 0 0 1-1V13a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1v26a1 1 0 0 0 1 1Z"
82
- }, null, -1)]), 14, Ne);
83
- }
84
- var ne = /* @__PURE__ */ xe(De, [["render", He]]);
85
- const Me = Object.assign(ne, {
86
- install: (p, m) => {
87
- var n;
88
- const l = (n = m == null ? void 0 : m.iconPrefix) != null ? n : "";
89
- p.component(l + ne.name, ne);
90
- }
91
- }), Ge = {
92
- class: "handle"
93
- }, je = /* @__PURE__ */ $({
94
- __name: "AuthkitPersonalInformation",
95
- props: {
96
- size: {
97
- type: String,
98
- required: !0
99
- }
100
- },
101
- emits: ["submit"],
102
- setup(p, {
103
- emit: m
104
- }) {
105
- const n = m, l = p, r = w({
106
- id: void 0,
107
- nickname: "",
108
- description: "",
109
- avatar: "",
110
- avatarUrl: ""
111
- }), d = w(!1), a = w(), t = w(!1), y = {
112
- color: "var(--huyooo-accent-primary)"
113
- };
114
- async function c() {
115
- t.value = !0;
116
- const {
117
- data: o
118
- } = await R.users.profile.post({});
119
- t.value = !1, o && (r.value.id = o.id, r.value.nickname = o.nickname, r.value.description = o.description, r.value.avatar = o.avatar, r.value.avatarUrl = o.avatarUrl);
120
- }
121
- async function v() {
122
- if (!await a.value.validate()) {
123
- t.value = !0;
124
- const u = {
125
- id: r.value.id,
126
- nickname: r.value.nickname,
127
- description: r.value.description,
128
- avatar: r.value.avatar
129
- }, {
130
- data: _,
131
- error: A
132
- } = await R.users.update.baseInfo.post(u);
133
- t.value = !1, !A && _ && (H.success("更新成功"), r.value.avatarUrl = _.avatarUrl, n("submit"));
134
- }
135
- }
136
- c();
137
- const f = () => {
138
- const {
139
- uploadFile: o
140
- } = Re(), u = document.createElement("input");
141
- u.type = "file", u.accept = "image/*", u.style.display = "none", document.body.append(u), u.addEventListener("change", async (_) => {
142
- var x;
143
- const C = (x = _.target.files) == null ? void 0 : x[0];
144
- if (C) {
145
- d.value = !0;
146
- try {
147
- o({
148
- bucketId: J.avatarBucketId,
149
- file: C,
150
- onFileFinish(B, F, Y) {
151
- d.value = !0;
152
- const ie = {
153
- id: r.value.id,
154
- nickname: r.value.nickname,
155
- description: r.value.description,
156
- avatar: Y.Key
157
- };
158
- (async () => {
159
- const {
160
- error: ae
161
- } = await R.users.update.baseInfo.post(ie);
162
- d.value = !1, ae || (H.success("更新成功"), c(), n("submit"));
163
- })();
164
- },
165
- onError(B) {
166
- console.error("上传图片失败"), d.value = !1;
167
- }
168
- });
169
- } catch (B) {
170
- console.error("上传图片失败", B), d.value = !1;
171
- }
172
- }
173
- u.remove();
174
- }), u.click();
175
- };
176
- return (o, u) => (g(), k(e(D), {
177
- ref_key: "formRef",
178
- ref: a,
179
- model: r.value,
180
- "auto-label-width": "",
181
- size: l.size
182
- }, {
183
- default: s(() => [i(e(z), {
184
- field: "avatar",
185
- label: "头像",
186
- rules: [{
187
- required: !1,
188
- message: "请上传头像"
189
- }]
190
- }, {
191
- default: s(() => [i(e(K), {
192
- "image-url": r.value.avatarUrl,
193
- size: 42,
194
- "object-fit": "cover",
195
- "trigger-icon-style": y,
196
- onClick: f
197
- }, {
198
- "trigger-icon": s(() => [i(e(Me))]),
199
- _: 1
200
- }, 8, ["image-url"])]),
201
- _: 1
202
- }), i(e(z), {
203
- field: "nickname",
204
- label: "昵称",
205
- rules: [{
206
- required: !1,
207
- message: "请输入昵称"
208
- }]
209
- }, {
210
- default: s(() => [i(e(P), {
211
- modelValue: r.value.nickname,
212
- "onUpdate:modelValue": u[0] || (u[0] = (_) => r.value.nickname = _),
213
- placeholder: "请输入昵称"
214
- }, null, 8, ["modelValue"])]),
215
- _: 1
216
- }), i(e(z), {
217
- field: "description",
218
- label: "简介",
219
- rules: [{
220
- required: !1,
221
- message: "请输入描述"
222
- }]
223
- }, {
224
- default: s(() => [i(e($e), {
225
- modelValue: r.value.description,
226
- "onUpdate:modelValue": u[1] || (u[1] = (_) => r.value.description = _),
227
- placeholder: "请输入描述",
228
- "allow-clear": "",
229
- "auto-size": {
230
- minRows: 5
231
- }
232
- }, null, 8, ["modelValue"])]),
233
- _: 1
234
- }), i(e(z), {
235
- field: "",
236
- label: "",
237
- rules: []
238
- }, {
239
- default: s(() => [h("div", Ge, [i(e(U), {
240
- type: "primary",
241
- loading: t.value,
242
- onClick: v
243
- }, {
244
- default: s(() => [...u[2] || (u[2] = [b(" 提交 ", -1)])]),
245
- _: 1
246
- }, 8, ["loading"])])]),
247
- _: 1
248
- })]),
249
- _: 1
250
- }, 8, ["model", "size"]));
251
- }
252
- }), We = /* @__PURE__ */ q(je, [["__scopeId", "data-v-1d138326"]]), Ke = /* @__PURE__ */ $({
253
- __name: "AuthkitSendVerifyCode",
254
- props: {
255
- size: {
256
- type: String,
257
- required: !0
258
- },
259
- loading: {
260
- type: Boolean,
261
- required: !0,
262
- default: () => !1
263
- }
264
- },
265
- emits: ["send"],
266
- setup(p, {
267
- expose: m,
268
- emit: n
269
- }) {
270
- const l = n, r = p, d = w(!1);
271
- let a;
272
- const t = w(0), y = O(() => t.value.toString().padStart(2, "0")), c = O(() => t.value > 0), v = () => {
273
- d.value && (t.value <= 0 ? (clearInterval(a), d.value = !1) : t.value--);
274
- };
275
- function f() {
276
- l("send");
277
- }
278
- function o() {
279
- t.value = 60, d.value = !0, a && clearInterval(a), a = setInterval(v, 1e3);
280
- }
281
- return W(() => {
282
- }), m({
283
- startCountFn: o
284
- }), ue(() => {
285
- a && clearInterval(a);
286
- }), (u, _) => (g(), k(e(U), {
287
- class: "OAuthItem",
288
- type: "primary",
289
- size: r.size,
290
- disabled: c.value,
291
- loading: r.loading,
292
- onClick: f
293
- }, {
294
- default: s(() => [_[0] || (_[0] = h("span", null, " 发送验证码", -1)), Se(h("span", {
295
- class: "verify-code-timer"
296
- }, T(`(${y.value})`), 513), [[ze, c.value]])]),
297
- _: 1
298
- }, 8, ["size", "disabled", "loading"]));
299
- }
300
- }), G = /* @__PURE__ */ q(Ke, [["__scopeId", "data-v-2883dc6d"]]), Ze = {
301
- class: "sendVerifyCodeItem"
302
- }, Je = {
303
- class: "handle"
304
- }, Qe = /* @__PURE__ */ $({
305
- __name: "AuthkitEmailVerify",
306
- props: {
307
- email: {
308
- type: String,
309
- required: !0,
310
- default: () => ""
311
- },
312
- size: {
313
- type: String,
314
- required: !0
315
- }
316
- },
317
- emits: ["next"],
318
- setup(p, {
319
- emit: m
320
- }) {
321
- const n = m, l = p, r = O(() => ge(l.email)), d = w(), a = w(!1), t = w(!1), y = w(), c = w({
322
- userToken: void 0,
323
- emailVerifyId: void 0
324
- });
325
- async function v() {
326
- a.value = !0;
327
- const {
328
- data: o
329
- } = await R.verify.email.retry.post({
330
- email: l.email
331
- });
332
- a.value = !1, o && (c.value.emailVerifyId = o.emailVerifyId, d.value.startCountFn());
333
- }
334
- async function f() {
335
- if (!await y.value.validate(["userToken"])) {
336
- t.value = !0;
337
- const u = {
338
- email: l.email,
339
- userToken: c.value.userToken,
340
- emailVerifyId: c.value.emailVerifyId
341
- }, {
342
- error: _
343
- } = await R.verify.email.post(u);
344
- t.value = !1, _ || n("next");
345
- }
346
- }
347
- return (o, u) => (g(), k(e(D), {
348
- ref_key: "formRef",
349
- ref: y,
350
- model: c.value,
351
- "auto-label-width": "",
352
- size: l.size
353
- }, {
354
- default: s(() => [i(e(z), {
355
- field: "email",
356
- label: "邮箱",
357
- rules: [{
358
- required: !1,
359
- message: "请输入邮箱"
360
- }, {
361
- type: "email",
362
- message: "请输入有效的邮箱"
363
- }]
364
- }, {
365
- default: s(() => [b(T(r.value), 1)]),
366
- _: 1
367
- }), i(e(z), {
368
- field: "userToken",
369
- label: "验证码",
370
- "hide-label": "",
371
- rules: [{
372
- required: !0,
373
- message: "请输入验证码"
374
- }]
375
- }, {
376
- default: s(() => [h("div", Ze, [i(e(P), {
377
- modelValue: c.value.userToken,
378
- "onUpdate:modelValue": u[0] || (u[0] = (_) => c.value.userToken = _),
379
- placeholder: "请输入验证码"
380
- }, null, 8, ["modelValue"]), i(G, {
381
- ref_key: "SendVerifyCodeRef",
382
- ref: d,
383
- size: l.size,
384
- loading: a.value,
385
- style: {
386
- "margin-left": "10px"
387
- },
388
- onSend: v
389
- }, null, 8, ["size", "loading"])])]),
390
- _: 1
391
- }), i(e(z), {
392
- field: "",
393
- label: "",
394
- rules: []
395
- }, {
396
- default: s(() => [h("div", Je, [i(e(U), {
397
- loading: t.value,
398
- type: "primary",
399
- onClick: f
400
- }, {
401
- default: s(() => [...u[1] || (u[1] = [b(" 提交 ", -1)])]),
402
- _: 1
403
- }, 8, ["loading"])])]),
404
- _: 1
405
- })]),
406
- _: 1
407
- }, 8, ["model", "size"]));
408
- }
409
- }), ce = /* @__PURE__ */ q(Qe, [["__scopeId", "data-v-73ed2006"]]), Xe = {
410
- class: "handle"
411
- }, Ye = /* @__PURE__ */ $({
412
- __name: "AuthkitPasswordUpdate",
413
- props: {
414
- size: {
415
- type: String,
416
- required: !0
417
- }
418
- },
419
- emits: ["submit"],
420
- setup(p, {
421
- emit: m
422
- }) {
423
- const n = m, l = w(!1), r = w(), d = p, a = w({
424
- oldPassword: "",
425
- password: "",
426
- confirmPassword: ""
427
- });
428
- async function t() {
429
- if (!await r.value.validate()) {
430
- l.value = !0;
431
- const c = {
432
- password: a.value.password
433
- }, {
434
- error: v
435
- } = await R.users.update.password.post(c);
436
- l.value = !1, v || n("submit", c);
437
- }
438
- }
439
- return (y, c) => (g(), k(e(D), {
440
- ref_key: "formRef",
441
- ref: r,
442
- model: a.value,
443
- "auto-label-width": "",
444
- size: d.size
445
- }, {
446
- default: s(() => [i(e(z), {
447
- field: "oldPassword",
448
- label: "当前密码",
449
- "hide-label": "",
450
- rules: [{
451
- required: !0,
452
- message: "请输入当前密码"
453
- }]
454
- }, {
455
- default: s(() => [i(e(P), {
456
- modelValue: a.value.oldPassword,
457
- "onUpdate:modelValue": c[0] || (c[0] = (v) => a.value.oldPassword = v),
458
- placeholder: "请输入当前密码",
459
- type: "password"
460
- }, null, 8, ["modelValue"])]),
461
- _: 1
462
- }), i(e(z), {
463
- field: "password",
464
- label: "新密码",
465
- "hide-label": "",
466
- rules: [{
467
- required: !0,
468
- message: "新密码请输入"
469
- }, {
470
- minLength: 10,
471
- message: "新密码不能少于10字符"
472
- }]
473
- }, {
474
- default: s(() => [i(e(P), {
475
- modelValue: a.value.password,
476
- "onUpdate:modelValue": c[1] || (c[1] = (v) => a.value.password = v),
477
- placeholder: "请输入新密码",
478
- type: "password"
479
- }, null, 8, ["modelValue"])]),
480
- _: 1
481
- }), i(e(z), {
482
- field: "confirmPassword",
483
- label: "确认密码",
484
- "hide-label": "",
485
- rules: [{
486
- required: !0,
487
- message: "请输入确认密码"
488
- }, {
489
- minLength: 10,
490
- message: "确认密码不能少于10字符"
491
- }, {
492
- validator: (v, f) => {
493
- v !== a.value.password ? f("两次密码输入不一致,请重新输入") : f();
494
- }
495
- }]
496
- }, {
497
- default: s(() => [i(e(P), {
498
- modelValue: a.value.confirmPassword,
499
- "onUpdate:modelValue": c[2] || (c[2] = (v) => a.value.confirmPassword = v),
500
- placeholder: "请输入确认密码密码",
501
- type: "password"
502
- }, null, 8, ["modelValue"])]),
503
- _: 1
504
- }, 8, ["rules"]), i(e(z), {
505
- field: "",
506
- label: "",
507
- rules: []
508
- }, {
509
- default: s(() => [h("div", Xe, [i(e(U), {
510
- type: "primary",
511
- loading: l.value,
512
- onClick: t
513
- }, {
514
- default: s(() => [...c[3] || (c[3] = [b(" 提交 ", -1)])]),
515
- _: 1
516
- }, 8, ["loading"])])]),
517
- _: 1
518
- })]),
519
- _: 1
520
- }, 8, ["model", "size"]));
521
- }
522
- }), et = /* @__PURE__ */ q(Ye, [["__scopeId", "data-v-f8bd086f"]]), tt = /* @__PURE__ */ $({
523
- __name: "AuthkitSetPassword",
524
- props: {
525
- size: {
526
- type: String,
527
- required: !0
528
- }
529
- },
530
- setup(p) {
531
- const {
532
- userProfile: m,
533
- loading: n,
534
- fetchUserProfile: l,
535
- isLoggedIn: r
536
- } = Q(), d = w("hidden"), a = p;
537
- function t(v) {
538
- d.value = v;
539
- }
540
- function y(v) {
541
- H.success("密码修改成功"), d.value = "hidden", l();
542
- }
543
- function c() {
544
- d.value = "update";
545
- }
546
- return W(() => {
547
- r.value && !m.value && l();
548
- }), (v, f) => {
549
- var o, u, _, A;
550
- return g(), V(j, null, [!((o = e(m)) != null && o.email) && !((u = e(m)) != null && u.phone) ? (g(), k(e(N), {
551
- key: 0,
552
- title: "去绑定邮箱"
553
- }, {
554
- action: s(() => [i(e(U), {
555
- size: a.size,
556
- type: "primary",
557
- onClick: f[0] || (f[0] = (C) => t("update"))
558
- }, {
559
- default: s(() => [...f[2] || (f[2] = [b(" 去绑定邮箱 ", -1)])]),
560
- _: 1
561
- }, 8, ["size"])]),
562
- default: s(() => [f[3] || (f[3] = b(" 请先去绑定邮箱或者手机号码,才能设置密码 ", -1))]),
563
- _: 1
564
- })) : I("", !0), (_ = e(m)) != null && _.email && d.value === "hidden" ? (g(), k(e(N), {
565
- key: 1,
566
- title: "更改密码"
567
- }, {
568
- action: s(() => [i(e(U), {
569
- size: a.size,
570
- type: "primary",
571
- onClick: f[1] || (f[1] = (C) => t("verify"))
572
- }, {
573
- default: s(() => [...f[4] || (f[4] = [b("更改密码", -1)])]),
574
- _: 1
575
- }, 8, ["size"])]),
576
- default: s(() => [f[5] || (f[5] = b(" 为了账户安全修改密码前会先验证身份 ", -1))]),
577
- _: 1
578
- })) : I("", !0), d.value === "update" ? (g(), k(et, {
579
- key: 2,
580
- size: a.size,
581
- loading: e(n),
582
- onSubmit: y
583
- }, null, 8, ["size", "loading"])) : I("", !0), d.value === "verify" ? (g(), k(ce, {
584
- key: 3,
585
- size: a.size,
586
- email: (A = e(m)) == null ? void 0 : A.email,
587
- onNext: c
588
- }, null, 8, ["size", "email"])) : I("", !0)], 64);
589
- };
590
- }
591
- }), it = {
592
- class: "content"
593
- }, at = {
594
- class: "sendVerifyCodeItem"
595
- }, st = {
596
- class: "handle"
597
- }, lt = /* @__PURE__ */ $({
598
- __name: "AuthkitEmailUpdate",
599
- props: {
600
- size: {
601
- type: String,
602
- required: !0
603
- },
604
- loading: {
605
- type: Boolean,
606
- required: !0,
607
- default: () => !0
608
- }
609
- },
610
- emits: ["submit"],
611
- setup(p, {
612
- emit: m
613
- }) {
614
- const n = m, l = p, r = w(), d = w(!1), a = w(), t = w({
615
- email: void 0,
616
- userToken: void 0,
617
- emailVerifyId: void 0,
618
- password: void 0,
619
- confirmPassword: void 0,
620
- referrerId: void 0
621
- });
622
- async function y() {
623
- if (!await a.value.validateField(["email"])) {
624
- d.value = !0;
625
- const {
626
- data: f
627
- } = await R.verify.email.retry.post({
628
- email: t.value.email
629
- });
630
- d.value = !1, f && (t.value.emailVerifyId = f.emailVerifyId, r.value.startCountFn());
631
- }
632
- }
633
- async function c() {
634
- a.value.validate().then((v) => {
635
- v || n("submit", t.value);
636
- });
637
- }
638
- return (v, f) => (g(), V("div", it, [i(e(D), {
639
- ref_key: "formRef",
640
- ref: a,
641
- model: t.value,
642
- size: l.size,
643
- "auto-label-width": ""
644
- }, {
645
- default: s(() => [i(e(z), {
646
- field: "email",
647
- label: "邮箱",
648
- "hide-label": "",
649
- rules: [{
650
- required: !0,
651
- message: "请输入邮箱"
652
- }, {
653
- type: "email",
654
- message: "请输入有效的邮箱"
655
- }]
656
- }, {
657
- default: s(() => [i(e(P), {
658
- modelValue: t.value.email,
659
- "onUpdate:modelValue": f[0] || (f[0] = (o) => t.value.email = o),
660
- placeholder: "请输入邮箱",
661
- autocomplete: "email username",
662
- type: "email"
663
- }, null, 8, ["modelValue"])]),
664
- _: 1
665
- }), i(e(z), {
666
- field: "userToken",
667
- label: "验证码",
668
- "hide-label": "",
669
- rules: [{
670
- required: !0,
671
- message: "请输入验证码"
672
- }]
673
- }, {
674
- default: s(() => [h("div", at, [i(e(P), {
675
- modelValue: t.value.userToken,
676
- "onUpdate:modelValue": f[1] || (f[1] = (o) => t.value.userToken = o),
677
- placeholder: "请输入验证码",
678
- autocomplete: "one-time-code"
679
- }, null, 8, ["modelValue"]), i(G, {
680
- ref_key: "SendVerifyCodeRef",
681
- ref: r,
682
- size: l.size,
683
- loading: d.value,
684
- style: {
685
- "margin-left": "10px"
686
- },
687
- onSend: y
688
- }, null, 8, ["size", "loading"])])]),
689
- _: 1
690
- }), i(e(z), {
691
- field: "password",
692
- label: "密码",
693
- "hide-label": "",
694
- rules: [{
695
- required: !0,
696
- message: "密码请输入"
697
- }, {
698
- minLength: 10,
699
- message: "密码不能少于10字符"
700
- }]
701
- }, {
702
- default: s(() => [i(e(P), {
703
- modelValue: t.value.password,
704
- "onUpdate:modelValue": f[2] || (f[2] = (o) => t.value.password = o),
705
- placeholder: "请输入密码",
706
- type: "password",
707
- autocomplete: "new-password"
708
- }, null, 8, ["modelValue"])]),
709
- _: 1
710
- }), i(e(z), {
711
- field: "confirmPassword",
712
- label: "确认密码",
713
- "hide-label": "",
714
- rules: [{
715
- required: !0,
716
- message: "请输入确认密码"
717
- }, {
718
- minLength: 10,
719
- message: "确认密码不能少于10字符"
720
- }, {
721
- validator: (o, u) => {
722
- o !== t.value.password ? u("两次密码输入不一致,请重新输入") : u();
723
- }
724
- }]
725
- }, {
726
- default: s(() => [i(e(P), {
727
- modelValue: t.value.confirmPassword,
728
- "onUpdate:modelValue": f[3] || (f[3] = (o) => t.value.confirmPassword = o),
729
- placeholder: "请输入确认密码密码",
730
- type: "password",
731
- autocomplete: "new-password"
732
- }, null, 8, ["modelValue"])]),
733
- _: 1
734
- }, 8, ["rules"]), i(e(z), {
735
- field: "referrerId",
736
- label: "邀请人",
737
- "hide-label": "",
738
- rules: [{
739
- required: !1,
740
- message: "请输入邀请人ID"
741
- }]
742
- }, {
743
- default: s(() => [i(e(P), {
744
- modelValue: t.value.referrerId,
745
- "onUpdate:modelValue": f[4] || (f[4] = (o) => t.value.referrerId = o),
746
- placeholder: "邀请人ID(可选)",
747
- autocomplete: "off"
748
- }, null, 8, ["modelValue"])]),
749
- _: 1
750
- }), h("div", st, [i(e(U), {
751
- type: "primary",
752
- loading: l.loading,
753
- long: "",
754
- size: l.size,
755
- onClick: c
756
- }, {
757
- default: s(() => [...f[5] || (f[5] = [b(" 提交 ", -1)])]),
758
- _: 1
759
- }, 8, ["loading", "size"])])]),
760
- _: 1
761
- }, 8, ["model", "size"])]));
762
- }
763
- }), ye = /* @__PURE__ */ q(lt, [["__scopeId", "data-v-51a26095"]]), ot = /* @__PURE__ */ $({
764
- __name: "AuthkitEmailBinding",
765
- props: {
766
- size: {
767
- type: String,
768
- required: !0
769
- }
770
- },
771
- setup(p) {
772
- const {
773
- userProfile: m,
774
- loading: n,
775
- fetchUserProfile: l
776
- } = Q(), r = w("hidden"), d = p;
777
- function a(c) {
778
- r.value = c;
779
- }
780
- async function t(c) {
781
- n.value = !0;
782
- const v = {
783
- email: c.email,
784
- userToken: c.userToken,
785
- emailVerifyId: c.emailVerifyId,
786
- password: c.password || ""
787
- // API 要求 password,但绑定邮箱时可能不需要,传空字符串
788
- }, {
789
- error: f
790
- } = await R.users.update.email.post(v);
791
- n.value = !1, f || (H.success("绑定成功"), r.value = "hidden", l());
792
- }
793
- function y() {
794
- r.value = "update";
795
- }
796
- return W(() => {
797
- m.value || l();
798
- }), (c, v) => {
799
- var f, o, u;
800
- return g(), V(j, null, [!((f = e(m)) != null && f.email) && r.value === "hidden" ? (g(), k(e(N), {
801
- key: 0,
802
- title: "绑定邮箱"
803
- }, {
804
- action: s(() => [i(e(U), {
805
- size: d.size,
806
- type: "primary",
807
- onClick: v[0] || (v[0] = (_) => a("update"))
808
- }, {
809
- default: s(() => [...v[2] || (v[2] = [b(" 绑定邮箱 ", -1)])]),
810
- _: 1
811
- }, 8, ["size"])]),
812
- default: s(() => [v[3] || (v[3] = b(" 您还未绑定邮箱,请点击绑定邮箱 ", -1))]),
813
- _: 1
814
- })) : I("", !0), (o = e(m)) != null && o.email && r.value === "hidden" ? (g(), k(e(N), {
815
- key: 1,
816
- title: "更改邮箱"
817
- }, {
818
- action: s(() => [i(e(U), {
819
- size: d.size,
820
- type: "primary",
821
- onClick: v[1] || (v[1] = (_) => a("verify"))
822
- }, {
823
- default: s(() => [...v[4] || (v[4] = [b(" 更改邮箱 ", -1)])]),
824
- _: 1
825
- }, 8, ["size"])]),
826
- default: s(() => {
827
- var _;
828
- return [b(T(`您绑定的邮箱为${e(ge)((_ = e(m)) == null ? void 0 : _.email)}`) + " ", 1)];
829
- }),
830
- _: 1
831
- })) : I("", !0), r.value === "update" ? (g(), k(ye, {
832
- key: 2,
833
- loading: e(n),
834
- size: d.size,
835
- onSubmit: t
836
- }, null, 8, ["loading", "size"])) : I("", !0), r.value === "verify" ? (g(), k(ce, {
837
- key: 3,
838
- size: d.size,
839
- email: (u = e(m)) == null ? void 0 : u.email,
840
- onNext: y
841
- }, null, 8, ["size", "email"])) : I("", !0)], 64);
842
- };
843
- }
844
- }), nt = /* @__PURE__ */ q(ot, [["__scopeId", "data-v-4cf783a6"]]), rt = /* @__PURE__ */ $({
845
- __name: "AuthkitGithubBinding",
846
- props: {
847
- size: {
848
- type: String,
849
- required: !0
850
- }
851
- },
852
- setup(p) {
853
- const {
854
- userProfile: m,
855
- fetchUserProfile: n
856
- } = Q(), l = w("hidden"), r = w(!1);
857
- let d;
858
- const a = p;
859
- function t(o) {
860
- l.value = o;
861
- }
862
- async function y() {
863
- const o = J.appId;
864
- if (!o) {
865
- console.error("GitHub OAuth 失败: appId 未配置");
866
- return;
867
- }
868
- const {
869
- data: u
870
- } = await R.oauth.github.login.get({
871
- appId: o
872
- });
873
- if (u) {
874
- const {
875
- redirectUri: _
876
- } = u;
877
- r.value = !0, window.open(_, "_blank");
878
- }
879
- }
880
- async function c() {
881
- const {
882
- error: o
883
- } = await R.users.unbind.email.post({});
884
- o || (H.success("解绑成功"), l.value = "hidden", n());
885
- }
886
- function v() {
887
- l.value === "bind" && (l.value = "hidden", y()), l.value === "unbind" && c();
888
- }
889
- function f() {
890
- r.value && n();
891
- }
892
- return W(() => {
893
- m.value || n(), d = setInterval(f, 1e3);
894
- }), ue(() => {
895
- d && clearInterval(d);
896
- }), (o, u) => {
897
- var _, A, C;
898
- return g(), V(j, null, [!((_ = e(m)) != null && _.github) && l.value === "hidden" ? (g(), k(e(N), {
899
- key: 0,
900
- title: "绑定GitHUb"
901
- }, {
902
- action: s(() => [i(e(U), {
903
- size: a.size,
904
- type: "primary",
905
- onClick: u[0] || (u[0] = (x) => t("bind"))
906
- }, {
907
- default: s(() => [...u[2] || (u[2] = [b(" 绑定GitHUb ", -1)])]),
908
- _: 1
909
- }, 8, ["size"])]),
910
- default: s(() => [u[3] || (u[3] = b(" 请尚未绑定GitHub,请点击绑定GitHUb ", -1))]),
911
- _: 1
912
- })) : I("", !0), (A = e(m)) != null && A.github && l.value === "hidden" ? (g(), k(e(N), {
913
- key: 1,
914
- title: "解绑GitHub"
915
- }, {
916
- action: s(() => [i(e(U), {
917
- size: a.size,
918
- type: "primary",
919
- onClick: u[1] || (u[1] = (x) => t("unbind"))
920
- }, {
921
- default: s(() => [...u[4] || (u[4] = [b(" 解绑GitHUb ", -1)])]),
922
- _: 1
923
- }, 8, ["size"])]),
924
- default: s(() => {
925
- var x, B, F;
926
- return [h("span", null, T(`您绑定的账号为 ${(B = (x = e(m)) == null ? void 0 : x.github) == null ? void 0 : B.login}`), 1), i(e(K), {
927
- "image-url": (F = e(m)) == null ? void 0 : F.avatar,
928
- size: 42
929
- }, null, 8, ["image-url"])];
930
- }),
931
- _: 1
932
- })) : I("", !0), l.value === "bind" || l.value === "unbind" ? (g(), k(ce, {
933
- key: 2,
934
- size: a.size,
935
- email: (C = e(m)) == null ? void 0 : C.email,
936
- onNext: v
937
- }, null, 8, ["size", "email"])) : I("", !0)], 64);
938
- };
939
- }
940
- }), ut = {
941
- class: "dependency-list"
942
- }, dt = {
943
- class: "label"
944
- }, ct = {
945
- class: "count"
946
- }, mt = {
947
- class: "action-bar"
948
- }, ft = /* @__PURE__ */ $({
949
- __name: "AuthkitAccountDelete",
950
- props: {
951
- size: {
952
- type: String,
953
- required: !0
954
- }
955
- },
956
- emits: ["deleted"],
957
- setup(p, {
958
- emit: m
959
- }) {
960
- const n = p, l = m, {
961
- userProfile: r,
962
- clearUserProfile: d
963
- } = Q(), {
964
- clearAuth: a
965
- } = X(), t = w("check"), y = w(!1), c = w([]), v = w(!1), f = w(""), o = w(0);
966
- let u = null;
967
- const _ = O(() => {
968
- var fe;
969
- const E = ((fe = r.value) == null ? void 0 : fe.email) || "";
970
- if (!E) return "";
971
- const [S, L] = E.split("@");
972
- return S.length <= 2 ? E : `${S.slice(0, 2)}***@${L}`;
973
- }), A = w(), C = w({
974
- userToken: "",
975
- password: "",
976
- confirmText: ""
977
- }), x = w(!1);
978
- function B(E, S) {
979
- E !== "注销" ? S('请输入"注销"以确认操作') : S();
980
- }
981
- async function F() {
982
- var E;
983
- if (y.value = !0, y.value = !1, !((E = r.value) != null && E.email)) {
984
- H.error("账号未绑定邮箱,无法进行注销验证。请先绑定邮箱");
985
- return;
986
- }
987
- t.value = "sendCode";
988
- }
989
- async function Y() {
990
- var S;
991
- if (!((S = r.value) != null && S.email)) {
992
- H.error("请先绑定邮箱");
993
- return;
994
- }
995
- v.value = !0;
996
- const {
997
- data: E
998
- } = await R.verify.email.retry.post({
999
- email: r.value.email
1000
- });
1001
- v.value = !1, E && (f.value = E.emailVerifyId, H.success("验证码已发送"), t.value = "confirm", ie());
1002
- }
1003
- function ie() {
1004
- o.value = 60, u && clearInterval(u), u = setInterval(() => {
1005
- o.value--, o.value <= 0 && u && (clearInterval(u), u = null);
1006
- }, 1e3);
1007
- }
1008
- async function ae() {
1009
- var L;
1010
- if (await ((L = A.value) == null ? void 0 : L.validate())) return;
1011
- x.value = !0;
1012
- const {
1013
- error: S
1014
- } = await R.users.deleteAccount.post({
1015
- password: C.value.password,
1016
- userToken: C.value.userToken,
1017
- emailVerifyId: f.value,
1018
- confirmText: C.value.confirmText
1019
- });
1020
- x.value = !1, S || (t.value = "success", d(), a(), l("deleted"));
1021
- }
1022
- function be() {
1023
- window.location.href = "/";
1024
- }
1025
- return (E, S) => t.value === "check" ? (g(), k(e(N), {
1026
- key: 0,
1027
- type: "warning",
1028
- title: "注销账号"
1029
- }, {
1030
- action: s(() => [i(e(U), {
1031
- size: n.size,
1032
- type: "primary",
1033
- status: "danger",
1034
- loading: y.value,
1035
- onClick: F
1036
- }, {
1037
- default: s(() => [b(T(y.value ? "检查中..." : "开始注销"), 1)]),
1038
- _: 1
1039
- }, 8, ["size", "loading"])]),
1040
- default: s(() => [S[6] || (S[6] = b(" 注销账号后,您的所有数据将被永久删除,无法恢复。请确认您已备份重要数据。 ", -1))]),
1041
- _: 1
1042
- })) : t.value === "dependencies" ? (g(), V(j, {
1043
- key: 1
1044
- }, [i(e(N), {
1045
- type: "error",
1046
- title: "无法注销账号"
1047
- }, {
1048
- default: s(() => [...S[7] || (S[7] = [b(" 您的账号下还有以下资源,请先处理后再注销: ", -1)])]),
1049
- _: 1
1050
- }), h("div", ut, [(g(!0), V(j, null, Ie(c.value, (L) => (g(), V("div", {
1051
- key: L.type,
1052
- class: "dependency-item"
1053
- }, [h("span", dt, T(L.label), 1), h("span", ct, T(L.count) + " 个", 1)]))), 128))]), h("div", mt, [i(e(U), {
1054
- size: n.size,
1055
- onClick: S[0] || (S[0] = (L) => t.value = "check")
1056
- }, {
1057
- default: s(() => [...S[8] || (S[8] = [b("返回", -1)])]),
1058
- _: 1
1059
- }, 8, ["size"])])], 64)) : t.value === "sendCode" ? (g(), k(e(N), {
1060
- key: 2,
1061
- type: "normal",
1062
- title: "身份验证"
1063
- }, {
1064
- action: s(() => [i(e(se), null, {
1065
- default: s(() => [i(e(U), {
1066
- size: n.size,
1067
- onClick: S[1] || (S[1] = (L) => t.value = "check")
1068
- }, {
1069
- default: s(() => [...S[9] || (S[9] = [b("取消", -1)])]),
1070
- _: 1
1071
- }, 8, ["size"]), i(e(U), {
1072
- size: n.size,
1073
- type: "primary",
1074
- loading: v.value,
1075
- onClick: Y
1076
- }, {
1077
- default: s(() => [b(T(v.value ? "发送中..." : "发送验证码"), 1)]),
1078
- _: 1
1079
- }, 8, ["size", "loading"])]),
1080
- _: 1
1081
- })]),
1082
- default: s(() => [b(" 为确保账号安全,我们将向您的邮箱 " + T(_.value) + " 发送验证码 ", 1)]),
1083
- _: 1
1084
- })) : t.value === "confirm" ? (g(), V(j, {
1085
- key: 3
1086
- }, [i(e(N), {
1087
- type: "warning",
1088
- title: "确认注销"
1089
- }, {
1090
- default: s(() => [b(" 验证码已发送至 " + T(_.value) + ",此操作不可逆,请谨慎操作 ", 1)]),
1091
- _: 1
1092
- }), i(e(D), {
1093
- ref_key: "formRef",
1094
- ref: A,
1095
- model: C.value,
1096
- size: n.size,
1097
- class: "confirm-form",
1098
- layout: "vertical"
1099
- }, {
1100
- default: s(() => [i(e(z), {
1101
- field: "userToken",
1102
- label: "邮箱验证码",
1103
- rules: [{
1104
- required: !0,
1105
- message: "请输入验证码"
1106
- }]
1107
- }, {
1108
- default: s(() => [i(e(se), null, {
1109
- default: s(() => [i(e(P), {
1110
- modelValue: C.value.userToken,
1111
- "onUpdate:modelValue": S[2] || (S[2] = (L) => C.value.userToken = L),
1112
- placeholder: "请输入6位验证码",
1113
- "max-length": 6,
1114
- "allow-clear": "",
1115
- style: {
1116
- width: "180px"
1117
- }
1118
- }, null, 8, ["modelValue"]), i(e(U), {
1119
- disabled: o.value > 0,
1120
- loading: v.value,
1121
- onClick: Y
1122
- }, {
1123
- default: s(() => [b(T(o.value > 0 ? `${o.value}s 后重发` : "重新发送"), 1)]),
1124
- _: 1
1125
- }, 8, ["disabled", "loading"])]),
1126
- _: 1
1127
- })]),
1128
- _: 1
1129
- }), i(e(z), {
1130
- field: "password",
1131
- label: "登录密码",
1132
- rules: [{
1133
- required: !0,
1134
- message: "请输入密码"
1135
- }]
1136
- }, {
1137
- default: s(() => [i(e(Ae), {
1138
- modelValue: C.value.password,
1139
- "onUpdate:modelValue": S[3] || (S[3] = (L) => C.value.password = L),
1140
- placeholder: "请输入您的登录密码",
1141
- "allow-clear": ""
1142
- }, null, 8, ["modelValue"])]),
1143
- _: 1
1144
- }), i(e(z), {
1145
- field: "confirmText",
1146
- label: "请输入「注销」以确认",
1147
- rules: [{
1148
- required: !0,
1149
- message: "请输入确认文字"
1150
- }, {
1151
- validator: B
1152
- }]
1153
- }, {
1154
- default: s(() => [i(e(P), {
1155
- modelValue: C.value.confirmText,
1156
- "onUpdate:modelValue": S[4] || (S[4] = (L) => C.value.confirmText = L),
1157
- placeholder: "注销",
1158
- "allow-clear": ""
1159
- }, null, 8, ["modelValue"])]),
1160
- _: 1
1161
- }, 8, ["rules"]), i(e(z), null, {
1162
- default: s(() => [i(e(se), null, {
1163
- default: s(() => [i(e(U), {
1164
- onClick: S[5] || (S[5] = (L) => t.value = "check")
1165
- }, {
1166
- default: s(() => [...S[10] || (S[10] = [b("取消", -1)])]),
1167
- _: 1
1168
- }), i(e(U), {
1169
- type: "primary",
1170
- status: "danger",
1171
- loading: x.value,
1172
- onClick: ae
1173
- }, {
1174
- default: s(() => [b(T(x.value ? "注销中..." : "确认注销"), 1)]),
1175
- _: 1
1176
- }, 8, ["loading"])]),
1177
- _: 1
1178
- })]),
1179
- _: 1
1180
- })]),
1181
- _: 1
1182
- }, 8, ["model", "size"])], 64)) : t.value === "success" ? (g(), k(e(Pe), {
1183
- key: 4,
1184
- status: "success",
1185
- title: "账号已注销"
1186
- }, {
1187
- subtitle: s(() => [...S[11] || (S[11] = [b(" 您的账号已成功注销,感谢您的使用 ", -1)])]),
1188
- extra: s(() => [i(e(U), {
1189
- type: "primary",
1190
- onClick: be
1191
- }, {
1192
- default: s(() => [...S[12] || (S[12] = [b("返回首页", -1)])]),
1193
- _: 1
1194
- })]),
1195
- _: 1
1196
- })) : I("", !0);
1197
- }
1198
- }), pt = /* @__PURE__ */ q(ft, [["__scopeId", "data-v-f68a27be"]]), vt = {
1199
- class: "content"
1200
- }, gt = {
1201
- class: "left"
1202
- }, yt = {
1203
- class: "right"
1204
- }, ht = /* @__PURE__ */ $({
1205
- __name: "AuthkitAppSetting",
1206
- emits: ["confirm", "cancel"],
1207
- setup(p, {
1208
- expose: m,
1209
- emit: n
1210
- }) {
1211
- const l = n;
1212
- function r() {
1213
- l("cancel");
1214
- }
1215
- function d() {
1216
- f.value = !1, l("cancel");
1217
- }
1218
- const a = w("large"), t = w(["PersonalInformation"]), y = w([{
1219
- name: "个人信息",
1220
- path: "PersonalInformation",
1221
- meta: {
1222
- icon: "mingcute:user-edit-fill"
1223
- },
1224
- children: []
1225
- }, {
1226
- name: "账户管理",
1227
- path: "AccountManage",
1228
- meta: {
1229
- icon: "mingcute:badge-fill"
1230
- },
1231
- children: [{
1232
- name: "邮箱",
1233
- path: "EmailBinding",
1234
- meta: {
1235
- icon: "ic:baseline-email"
1236
- }
1237
- }, {
1238
- name: "密码",
1239
- path: "SetPassword",
1240
- meta: {
1241
- icon: "mdi:password"
1242
- }
1243
- }, {
1244
- name: "注销账号",
1245
- path: "AccountDelete",
1246
- meta: {
1247
- icon: "mdi:account-remove"
1248
- }
1249
- }]
1250
- }, {
1251
- name: "第三方账户",
1252
- path: "AccountBinding",
1253
- meta: {
1254
- icon: "mingcute:link-fill"
1255
- },
1256
- children: [
1257
- {
1258
- name: "GitHub",
1259
- path: "GithubBinding",
1260
- meta: {
1261
- icon: "bi:github"
1262
- }
1263
- }
1264
- // {
1265
- // name: '微信',
1266
- // icon: 'Menus/Space/Message/NoticeNotifications',
1267
- // path: 'NoticeNotifications',
1268
- // },
1269
- ]
1270
- }]);
1271
- function c(u) {
1272
- const _ = u.path;
1273
- t.value = [_];
1274
- }
1275
- const {
1276
- changeType: v,
1277
- show: f
1278
- } = Oe(l);
1279
- function o(u, _) {
1280
- f.value = _, v.value = "编辑";
1281
- }
1282
- return m({
1283
- setData: o
1284
- }), (u, _) => (g(), k(e(ve), {
1285
- visible: e(f),
1286
- "onUpdate:visible": _[1] || (_[1] = (A) => Ve(f) ? f.value = A : null),
1287
- "unmount-on-close": "",
1288
- "body-class": "AppSettingbodyClass",
1289
- "mask-closable": !1,
1290
- footer: !1,
1291
- width: "700px",
1292
- onCancel: r
1293
- }, {
1294
- title: s(() => [..._[2] || (_[2] = [b(" 系统设置 ", -1)])]),
1295
- default: s(() => [h("div", vt, [h("div", gt, [i(Le, {
1296
- "selected-keys": t.value,
1297
- "onUpdate:selectedKeys": _[0] || (_[0] = (A) => t.value = A),
1298
- menus: y.value,
1299
- onChange: c
1300
- }, null, 8, ["selected-keys", "menus"])]), h("div", yt, [t.value[0] === "PersonalInformation" ? (g(), k(We, {
1301
- key: 0,
1302
- size: a.value
1303
- }, null, 8, ["size"])) : I("", !0), t.value[0] === "EmailBinding" ? (g(), k(nt, {
1304
- key: 1,
1305
- size: a.value
1306
- }, null, 8, ["size"])) : I("", !0), t.value[0] === "SetPassword" ? (g(), k(tt, {
1307
- key: 2,
1308
- size: a.value
1309
- }, null, 8, ["size"])) : I("", !0), t.value[0] === "GithubBinding" ? (g(), k(rt, {
1310
- key: 3,
1311
- size: a.value
1312
- }, null, 8, ["size"])) : I("", !0), t.value[0] === "AccountDelete" ? (g(), k(pt, {
1313
- key: 4,
1314
- size: a.value,
1315
- onDeleted: d
1316
- }, null, 8, ["size"])) : I("", !0)])])]),
1317
- _: 1
1318
- }, 8, ["visible"]));
1319
- }
1320
- }), fa = /* @__PURE__ */ q(ht, [["__scopeId", "data-v-1ff986a5"]]);
1321
- function he() {
1322
- return J.oauthCallbackUrl ? J.oauthCallbackUrl : `${window.location.origin}/auth/callback`;
1323
- }
1324
- function _t() {
1325
- const p = window.location.pathname + window.location.search;
1326
- p.includes("/auth/callback") || sessionStorage.setItem("auth_redirect", p);
1327
- }
1328
- async function te(p, m) {
1329
- const n = J.appId;
1330
- if (!n) {
1331
- console.error(`${p} OAuth 失败: appId 未配置`);
1332
- return;
1333
- }
1334
- const l = he(), r = {
1335
- appId: n,
1336
- referrerId: m == null ? void 0 : m.referrerId,
1337
- redirectUri: l
1338
- };
1339
- _t();
1340
- const d = {
1341
- github: () => R.oauth.github.login.get(r),
1342
- google: () => R.oauth.google.login.get(r),
1343
- microsoft: () => R.oauth.microsoft.login.get(r)
1344
- };
1345
- try {
1346
- const {
1347
- data: a
1348
- } = await d[p]();
1349
- a != null && a.redirectUri ? window.location.href = a.redirectUri : console.error(`${p} OAuth 重定向URL为空`);
1350
- } catch (a) {
1351
- console.error(`${p} OAuth 授权失败:`, a);
1352
- }
1353
- }
1354
- function wt(p) {
1355
- te("github", {
1356
- referrerId: p
1357
- });
1358
- }
1359
- function bt(p) {
1360
- te("google", {
1361
- referrerId: p
1362
- });
1363
- }
1364
- function kt(p) {
1365
- te("microsoft", {
1366
- referrerId: p
1367
- });
1368
- }
1369
- function St() {
1370
- return {
1371
- githubAuth: wt,
1372
- googleAuth: bt,
1373
- microsoftAuth: kt,
1374
- startOauth: te,
1375
- getOauthCallbackUrl: he
1376
- };
1377
- }
1378
- const re = /* @__PURE__ */ $({
1379
- __name: "AuthkitOauthItem",
1380
- props: {
1381
- size: {
1382
- type: String,
1383
- required: !0
1384
- },
1385
- icon: {
1386
- type: String,
1387
- required: !0,
1388
- default: () => ""
1389
- },
1390
- label: {
1391
- type: String,
1392
- required: !0,
1393
- default: () => ""
1394
- }
1395
- },
1396
- emits: [],
1397
- setup(p, {
1398
- emit: m
1399
- }) {
1400
- const n = p;
1401
- return (l, r) => (g(), k(e(U), {
1402
- class: "OAuthItem",
1403
- type: "primary",
1404
- size: n.size
1405
- }, {
1406
- icon: s(() => [i(e(Fe), {
1407
- icon: n.icon
1408
- }, null, 8, ["icon"])]),
1409
- default: s(() => [h("span", null, T(n.label), 1)]),
1410
- _: 1
1411
- }, 8, ["size"]));
1412
- }
1413
- }), zt = {
1414
- class: "OAuthList"
1415
- }, It = {
1416
- class: "OAuthList"
1417
- }, Vt = /* @__PURE__ */ $({
1418
- __name: "AuthkitOauthList",
1419
- props: {
1420
- size: {
1421
- type: String,
1422
- default: () => "large"
1423
- },
1424
- appId: {
1425
- type: String,
1426
- default: () => ""
1427
- }
1428
- },
1429
- setup(p) {
1430
- const {
1431
- appsData: m
1432
- } = de(), n = p, {
1433
- githubAuth: l,
1434
- googleAuth: r,
1435
- microsoftAuth: d
1436
- } = St(), a = O(() => !(!m.value.oauth.google.enabled && !m.value.oauth.microsoft.enabled && !m.value.oauth.github.enabled && !m.value.oauth.wechat.enabled));
1437
- return (t, y) => (g(), V("div", zt, [a.value ? (g(), k(e(Ce), {
1438
- key: 0,
1439
- orientation: "center"
1440
- }, {
1441
- default: s(() => [...y[3] || (y[3] = [b("OAuth登陆", -1)])]),
1442
- _: 1
1443
- })) : I("", !0), h("div", It, [e(m).oauth.github.enabled ? (g(), k(re, {
1444
- key: 0,
1445
- icon: "mdi:github",
1446
- label: "Github",
1447
- size: n.size,
1448
- onClick: y[0] || (y[0] = (c) => e(l)())
1449
- }, null, 8, ["size"])) : I("", !0), e(m).oauth.google.enabled ? (g(), k(re, {
1450
- key: 1,
1451
- icon: "mdi:google",
1452
- label: "Google",
1453
- size: n.size,
1454
- onClick: y[1] || (y[1] = (c) => e(r)())
1455
- }, null, 8, ["size"])) : I("", !0), e(m).oauth.microsoft.enabled ? (g(), k(re, {
1456
- key: 2,
1457
- icon: "mdi:microsoft",
1458
- label: "Microsoft",
1459
- size: n.size,
1460
- onClick: y[2] || (y[2] = (c) => e(d)())
1461
- }, null, 8, ["size"])) : I("", !0)])]));
1462
- }
1463
- }), $t = /* @__PURE__ */ q(Vt, [["__scopeId", "data-v-886fd902"]]), At = {
1464
- class: "content"
1465
- }, Pt = {
1466
- class: "sendVerifyCodeItem"
1467
- }, Ct = {
1468
- class: "handle"
1469
- }, Ut = /* @__PURE__ */ $({
1470
- __name: "AuthkitPasswordUpdateAndVerify",
1471
- props: {
1472
- size: {
1473
- type: String,
1474
- required: !0
1475
- },
1476
- loading: {
1477
- type: Boolean,
1478
- required: !0,
1479
- default: () => !0
1480
- }
1481
- },
1482
- emits: ["signIn", "submit"],
1483
- setup(p, {
1484
- emit: m
1485
- }) {
1486
- const n = m, l = p, r = w(), d = w(!1), a = w(), t = w({
1487
- email: void 0,
1488
- userToken: void 0,
1489
- emailVerifyId: void 0,
1490
- password: void 0,
1491
- confirmPassword: void 0
1492
- });
1493
- async function y() {
1494
- if (!await a.value.validateField(["email"])) {
1495
- d.value = !0;
1496
- const {
1497
- data: f
1498
- } = await R.verify.email.retry.post({
1499
- email: t.value.email
1500
- });
1501
- d.value = !1, f && (t.value.emailVerifyId = f.emailVerifyId, r.value.startCountFn());
1502
- }
1503
- }
1504
- async function c() {
1505
- a.value.validate().then((v) => {
1506
- v || n("submit", t.value);
1507
- });
1508
- }
1509
- return (v, f) => (g(), V("div", At, [i(e(D), {
1510
- ref_key: "formRef",
1511
- ref: a,
1512
- model: t.value,
1513
- size: l.size,
1514
- "auto-label-width": ""
1515
- }, {
1516
- default: s(() => [i(e(z), {
1517
- field: "email",
1518
- label: "邮箱",
1519
- "hide-label": "",
1520
- rules: [{
1521
- required: !0,
1522
- message: "请输入邮箱"
1523
- }, {
1524
- type: "email",
1525
- message: "请输入有效的邮箱"
1526
- }]
1527
- }, {
1528
- default: s(() => [i(e(P), {
1529
- modelValue: t.value.email,
1530
- "onUpdate:modelValue": f[0] || (f[0] = (o) => t.value.email = o),
1531
- placeholder: "请输入邮箱"
1532
- }, null, 8, ["modelValue"])]),
1533
- _: 1
1534
- }), i(e(z), {
1535
- field: "userToken",
1536
- label: "验证码",
1537
- "hide-label": "",
1538
- rules: [{
1539
- required: !0,
1540
- message: "请输入验证码"
1541
- }]
1542
- }, {
1543
- default: s(() => [h("div", Pt, [i(e(P), {
1544
- modelValue: t.value.userToken,
1545
- "onUpdate:modelValue": f[1] || (f[1] = (o) => t.value.userToken = o),
1546
- placeholder: "请输入验证码"
1547
- }, null, 8, ["modelValue"]), i(G, {
1548
- ref_key: "SendVerifyCodeRef",
1549
- ref: r,
1550
- size: l.size,
1551
- loading: d.value,
1552
- style: {
1553
- "margin-left": "10px"
1554
- },
1555
- onSend: y
1556
- }, null, 8, ["size", "loading"])])]),
1557
- _: 1
1558
- }), i(e(z), {
1559
- field: "password",
1560
- label: "密码",
1561
- "hide-label": "",
1562
- rules: [{
1563
- required: !0,
1564
- message: "密码请输入"
1565
- }, {
1566
- minLength: 10,
1567
- message: "密码不能少于10字符"
1568
- }]
1569
- }, {
1570
- default: s(() => [i(e(P), {
1571
- modelValue: t.value.password,
1572
- "onUpdate:modelValue": f[2] || (f[2] = (o) => t.value.password = o),
1573
- placeholder: "请输入密码",
1574
- type: "password",
1575
- autocomplete: ""
1576
- }, null, 8, ["modelValue"])]),
1577
- _: 1
1578
- }), i(e(z), {
1579
- field: "confirmPassword",
1580
- label: "确认密码",
1581
- "hide-label": "",
1582
- rules: [{
1583
- required: !0,
1584
- message: "请输入确认密码"
1585
- }, {
1586
- minLength: 10,
1587
- message: "确认密码不能少于10字符"
1588
- }, {
1589
- validator: (o, u) => {
1590
- o !== t.value.password ? u("两次密码输入不一致,请重新输入") : u();
1591
- }
1592
- }]
1593
- }, {
1594
- default: s(() => [i(e(P), {
1595
- modelValue: t.value.confirmPassword,
1596
- "onUpdate:modelValue": f[3] || (f[3] = (o) => t.value.confirmPassword = o),
1597
- placeholder: "请输入确认密码密码",
1598
- type: "password",
1599
- autocomplete: ""
1600
- }, null, 8, ["modelValue"])]),
1601
- _: 1
1602
- }, 8, ["rules"]), h("div", Ct, [i(e(U), {
1603
- type: "primary",
1604
- loading: l.loading,
1605
- long: "",
1606
- size: l.size,
1607
- onClick: c
1608
- }, {
1609
- default: s(() => [...f[4] || (f[4] = [b(" 提交 ", -1)])]),
1610
- _: 1
1611
- }, 8, ["loading", "size"])])]),
1612
- _: 1
1613
- }, 8, ["model", "size"])]));
1614
- }
1615
- }), qt = /* @__PURE__ */ q(Ut, [["__scopeId", "data-v-50b04889"]]), Rt = {
1616
- class: "SwitchSignIn"
1617
- }, xt = /* @__PURE__ */ $({
1618
- __name: "AuthkitSwitchSignIn",
1619
- emits: ["switchSignIn"],
1620
- setup(p, {
1621
- emit: m
1622
- }) {
1623
- const n = m;
1624
- function l() {
1625
- n("switchSignIn");
1626
- }
1627
- return (r, d) => (g(), V("div", Rt, [h("span", null, [d[1] || (d[1] = h("span", null, "已经有账号?", -1)), i(e(M), {
1628
- style: {
1629
- padding: "0px"
1630
- },
1631
- onClick: l
1632
- }, {
1633
- default: s(() => [...d[0] || (d[0] = [b("去登陆", -1)])]),
1634
- _: 1
1635
- })])]));
1636
- }
1637
- }), me = /* @__PURE__ */ q(xt, [["__scopeId", "data-v-fc1d3903"]]), Tt = {
1638
- class: "ResetPassword"
1639
- }, Bt = /* @__PURE__ */ $({
1640
- __name: "AuthkitResetPassword",
1641
- props: {
1642
- size: {
1643
- type: String,
1644
- required: !0,
1645
- default: () => "large"
1646
- },
1647
- loading: {
1648
- type: Boolean,
1649
- required: !0,
1650
- default: () => !0
1651
- }
1652
- },
1653
- emits: ["switchSignIn", "submit"],
1654
- setup(p, {
1655
- emit: m
1656
- }) {
1657
- const n = m, l = p;
1658
- function r() {
1659
- n("switchSignIn");
1660
- }
1661
- async function d(a) {
1662
- n("submit", a);
1663
- }
1664
- return (a, t) => (g(), V("div", Tt, [i(qt, {
1665
- loading: p.loading,
1666
- size: l.size,
1667
- onSubmit: d
1668
- }, null, 8, ["loading", "size"]), i(me, {
1669
- onSwitchSignIn: r
1670
- })]));
1671
- }
1672
- }), Lt = /* @__PURE__ */ q(Bt, [["__scopeId", "data-v-0622cbe3"]]), Ot = {
1673
- key: 0,
1674
- class: "ServiceAgreementAndPrivacyProtection"
1675
- }, Ft = {
1676
- key: 1
1677
- }, Et = /* @__PURE__ */ $({
1678
- __name: "AuthkitServiceAgreementAndPrivacyProtection",
1679
- emits: ["toUserServiceAgreement", "toPrivacyPolicy"],
1680
- setup(p, {
1681
- emit: m
1682
- }) {
1683
- const n = m, {
1684
- getLink: l
1685
- } = Ee(), r = O(() => {
1686
- const c = l("userServiceAgreement");
1687
- return c != null && c.configured ? c : void 0;
1688
- }), d = O(() => {
1689
- const c = l("privacyPolicy");
1690
- return c != null && c.configured ? c : void 0;
1691
- }), a = O(() => !!(r.value || d.value));
1692
- function t() {
1693
- n("toUserServiceAgreement");
1694
- }
1695
- function y() {
1696
- n("toPrivacyPolicy");
1697
- }
1698
- return (c, v) => a.value ? (g(), V("div", Ot, [v[0] || (v[0] = h("span", null, "注册登陆即表示同意", -1)), r.value ? (g(), k(e(M), {
1699
- key: 0,
1700
- onClick: t
1701
- }, {
1702
- default: s(() => [b(T(r.value.label), 1)]),
1703
- _: 1
1704
- })) : I("", !0), r.value && d.value ? (g(), V("span", Ft, "和")) : I("", !0), d.value ? (g(), k(e(M), {
1705
- key: 2,
1706
- onClick: y
1707
- }, {
1708
- default: s(() => [b(T(d.value.label), 1)]),
1709
- _: 1
1710
- })) : I("", !0)])) : I("", !0);
1711
- }
1712
- }), Dt = /* @__PURE__ */ q(Et, [["__scopeId", "data-v-c45a9ad9"]]), Nt = {
1713
- class: "content"
1714
- }, Ht = {
1715
- class: "handle"
1716
- }, Mt = /* @__PURE__ */ $({
1717
- __name: "AuthkitPasswordAuth",
1718
- props: {
1719
- size: {
1720
- type: String,
1721
- required: !0
1722
- },
1723
- loading: {
1724
- type: Boolean,
1725
- required: !0,
1726
- default: () => !0
1727
- }
1728
- },
1729
- emits: ["submit"],
1730
- setup(p, {
1731
- emit: m
1732
- }) {
1733
- const n = m, l = p;
1734
- async function r(y, c) {
1735
- var x;
1736
- if (!y) {
1737
- c("请输入密码");
1738
- return;
1739
- }
1740
- const {
1741
- data: v,
1742
- error: f
1743
- } = await R.verify.password.post({
1744
- password: y
1745
- });
1746
- if (f) {
1747
- c(f.message || "密码验证请求出错!");
1748
- return;
1749
- }
1750
- if (!v) {
1751
- c("密码验证请求出错!");
1752
- return;
1753
- }
1754
- const {
1755
- isPass: o,
1756
- feedback: u,
1757
- score: _,
1758
- minPasswordComplexity: A
1759
- } = v;
1760
- if (!(o === !0 || o === "true" || typeof o == "boolean" && o)) {
1761
- const B = (u == null ? void 0 : u.warning) || ((x = u == null ? void 0 : u.suggestions) != null && x.length ? u.suggestions.join(", ") : "") || "密码强度不足";
1762
- c(B);
1763
- return;
1764
- }
1765
- c();
1766
- }
1767
- const d = w(), a = w({
1768
- email: void 0,
1769
- password: void 0
1770
- });
1771
- async function t() {
1772
- d.value.validate().then((y) => {
1773
- y || n("submit", a.value);
1774
- });
1775
- }
1776
- return (y, c) => (g(), V("div", Nt, [i(e(D), {
1777
- ref_key: "formRef",
1778
- ref: d,
1779
- model: a.value,
1780
- size: l.size,
1781
- "auto-label-width": ""
1782
- }, {
1783
- default: s(() => [i(e(z), {
1784
- field: "email",
1785
- label: "邮箱",
1786
- "hide-label": "",
1787
- rules: [{
1788
- required: !0,
1789
- message: "请输入邮箱"
1790
- }, {
1791
- type: "email",
1792
- message: "请输入有效的邮箱"
1793
- }]
1794
- }, {
1795
- default: s(() => [i(e(P), {
1796
- modelValue: a.value.email,
1797
- "onUpdate:modelValue": c[0] || (c[0] = (v) => a.value.email = v),
1798
- placeholder: "请输入邮箱",
1799
- autocomplete: "email username",
1800
- type: "email"
1801
- }, null, 8, ["modelValue"])]),
1802
- _: 1
1803
- }), i(e(z), {
1804
- field: "password",
1805
- label: "密码",
1806
- "hide-label": "",
1807
- rules: [{
1808
- required: !0,
1809
- message: "请输入密码"
1810
- }, {
1811
- validator: r
1812
- }]
1813
- }, {
1814
- default: s(() => [i(e(P), {
1815
- modelValue: a.value.password,
1816
- "onUpdate:modelValue": c[1] || (c[1] = (v) => a.value.password = v),
1817
- placeholder: "请输入密码",
1818
- type: "password",
1819
- autocomplete: "current-password"
1820
- }, null, 8, ["modelValue"])]),
1821
- _: 1
1822
- }, 8, ["rules"]), h("div", Ht, [i(e(U), {
1823
- type: "primary",
1824
- loading: l.loading,
1825
- long: "",
1826
- size: l.size,
1827
- onClick: t
1828
- }, {
1829
- default: s(() => [...c[2] || (c[2] = [b(" 登陆 ", -1)])]),
1830
- _: 1
1831
- }, 8, ["loading", "size"])])]),
1832
- _: 1
1833
- }, 8, ["model", "size"])]));
1834
- }
1835
- }), Gt = /* @__PURE__ */ q(Mt, [["__scopeId", "data-v-a5b44bae"]]), jt = {
1836
- class: "SwitchSignUpOrResetPassword"
1837
- }, Wt = /* @__PURE__ */ $({
1838
- __name: "AuthkitSwitchSignUpOrResetPassword",
1839
- emits: ["switchSignUp", "switchResetPassword"],
1840
- setup(p, {
1841
- emit: m
1842
- }) {
1843
- const n = m;
1844
- function l() {
1845
- n("switchSignUp");
1846
- }
1847
- function r() {
1848
- n("switchResetPassword");
1849
- }
1850
- return (d, a) => (g(), V("div", jt, [h("span", null, [a[1] || (a[1] = h("span", null, " 还没有账户?", -1)), i(e(M), {
1851
- style: {
1852
- padding: "0px"
1853
- },
1854
- onClick: l
1855
- }, {
1856
- default: s(() => [...a[0] || (a[0] = [b("去注册?", -1)])]),
1857
- _: 1
1858
- })]), i(e(M), {
1859
- style: {
1860
- padding: "0px"
1861
- },
1862
- onClick: r
1863
- }, {
1864
- default: s(() => [...a[2] || (a[2] = [b(" 忘记密码?", -1)])]),
1865
- _: 1
1866
- })]));
1867
- }
1868
- }), _e = /* @__PURE__ */ q(Wt, [["__scopeId", "data-v-14e3aab2"]]), Kt = {
1869
- class: "SignIn"
1870
- }, Zt = /* @__PURE__ */ $({
1871
- __name: "AuthkitSignIn",
1872
- props: {
1873
- size: {
1874
- type: String,
1875
- required: !0
1876
- },
1877
- loading: {
1878
- type: Boolean,
1879
- required: !0,
1880
- default: () => !0
1881
- }
1882
- },
1883
- emits: ["submit", "switchSignUp", "switchResetPassword"],
1884
- setup(p, {
1885
- emit: m
1886
- }) {
1887
- const n = m, l = p, r = pe(), d = O(() => !!r.OAuth);
1888
- function a() {
1889
- n("switchSignUp");
1890
- }
1891
- function t() {
1892
- n("switchResetPassword");
1893
- }
1894
- async function y(c) {
1895
- n("submit", c);
1896
- }
1897
- return (c, v) => (g(), V("div", Kt, [I("", !0), i(Gt, {
1898
- loading: l.loading,
1899
- size: l.size,
1900
- onSubmit: y
1901
- }, null, 8, ["loading", "size"]), d.value ? ee(c.$slots, "OAuth", {
1902
- key: 1
1903
- }, void 0, !0) : I("", !0), i(_e, {
1904
- onSwitchSignUp: a,
1905
- onSwitchResetPassword: t
1906
- })]));
1907
- }
1908
- }), Jt = /* @__PURE__ */ q(Zt, [["__scopeId", "data-v-f52ce3b3"]]), Qt = {
1909
- class: "SignUp"
1910
- }, Xt = /* @__PURE__ */ $({
1911
- __name: "AuthkitSignUp",
1912
- props: {
1913
- size: {
1914
- type: String,
1915
- required: !0
1916
- },
1917
- loading: {
1918
- type: Boolean,
1919
- required: !0,
1920
- default: () => !0
1921
- }
1922
- },
1923
- emits: ["switchSignIn", "submit"],
1924
- setup(p, {
1925
- emit: m
1926
- }) {
1927
- const n = m, l = p;
1928
- function r() {
1929
- n("switchSignIn");
1930
- }
1931
- async function d(a) {
1932
- n("submit", a);
1933
- }
1934
- return (a, t) => (g(), V("div", Qt, [i(ye, {
1935
- size: l.size,
1936
- loading: p.loading,
1937
- onSubmit: d
1938
- }, null, 8, ["size", "loading"]), i(me, {
1939
- onSwitchSignIn: r
1940
- })]));
1941
- }
1942
- }), Yt = /* @__PURE__ */ q(Xt, [["__scopeId", "data-v-058bbbef"]]), ei = ["src"], ti = /* @__PURE__ */ $({
1943
- __name: "AuthkitAuthTitle",
1944
- props: {
1945
- size: {
1946
- type: [String, Number],
1947
- required: !1,
1948
- default: 30
1949
- },
1950
- fontSize: {
1951
- type: Number,
1952
- required: !1,
1953
- default: 18
1954
- },
1955
- lineHeight: {
1956
- type: Number,
1957
- required: !1,
1958
- default: 60
1959
- }
1960
- },
1961
- setup(p) {
1962
- const m = p, n = `${m.size}px`, l = `${m.fontSize}px`, r = `${m.lineHeight}px`, {
1963
- currentView: d
1964
- } = X(), {
1965
- appsData: a
1966
- } = de(), t = O(() => d.value === "signIn" ? `${a.value.name}登录` : d.value === "signUp" ? `${a.value.name}账号注册` : d.value === "resetPassword" ? `${a.value.name}密码重置` : "");
1967
- return (y, c) => (g(), V("div", {
1968
- class: "Title",
1969
- style: Z({
1970
- fontSize: l,
1971
- lineHeight: r
1972
- })
1973
- }, [e(a).applicationLogoUrl ? (g(), V("img", {
1974
- key: 0,
1975
- src: e(a).applicationLogoUrl,
1976
- srcset: "",
1977
- style: Z({
1978
- width: n
1979
- })
1980
- }, null, 12, ei)) : I("", !0), h("span", null, T(t.value), 1), ee(y.$slots, "default", {}, void 0, !0)], 4));
1981
- }
1982
- }), we = /* @__PURE__ */ q(ti, [["__scopeId", "data-v-8ebe7939"]]), ii = {
1983
- class: "Auth"
1984
- }, ai = {
1985
- class: "body"
1986
- }, si = /* @__PURE__ */ $({
1987
- __name: "AuthkitAuth",
1988
- props: {
1989
- size: {
1990
- type: String,
1991
- required: !0
1992
- },
1993
- showTitle: {
1994
- type: Boolean,
1995
- default: () => !0
1996
- }
1997
- },
1998
- emits: ["toPrivacyPolicy", "toUserServiceAgreement"],
1999
- setup(p, {
2000
- emit: m
2001
- }) {
2002
- const n = p, l = m, {
2003
- signInSubmit: r,
2004
- signUpSubmit: d,
2005
- resetPasswordSubmit: a,
2006
- currentView: t,
2007
- authSignInLoading: y,
2008
- authSignUpLoading: c,
2009
- resetPasswordLoading: v,
2010
- switchSignUp: f,
2011
- switchResetPassword: o,
2012
- switchSignIn: u
2013
- } = X(), {
2014
- appsAuthPageInfoApi: _
2015
- } = de();
2016
- function A() {
2017
- l("toPrivacyPolicy");
2018
- }
2019
- function C() {
2020
- l("toUserServiceAgreement");
2021
- }
2022
- return _(), (x, B) => (g(), V("div", ii, [p.showTitle ? (g(), k(we, {
2023
- key: 0,
2024
- size: 32,
2025
- "font-size": 20
2026
- })) : I("", !0), h("div", ai, [e(t) === "signIn" ? (g(), k(Jt, {
2027
- key: 0,
2028
- size: n.size,
2029
- loading: e(y),
2030
- onSwitchSignUp: e(f),
2031
- onSwitchResetPassword: e(o),
2032
- onSubmit: B[0] || (B[0] = (F) => e(r)(F))
2033
- }, {
2034
- OAuth: s(() => [i($t, {
2035
- size: n.size
2036
- }, null, 8, ["size"])]),
2037
- _: 1
2038
- }, 8, ["size", "loading", "onSwitchSignUp", "onSwitchResetPassword"])) : e(t) === "signUp" ? (g(), k(Yt, {
2039
- key: 1,
2040
- size: n.size,
2041
- loading: e(c),
2042
- onSwitchSignIn: e(u),
2043
- onSubmit: B[1] || (B[1] = (F) => e(d)(F))
2044
- }, null, 8, ["size", "loading", "onSwitchSignIn"])) : e(t) === "resetPassword" ? (g(), k(Lt, {
2045
- key: 2,
2046
- size: n.size,
2047
- loading: e(v),
2048
- onSwitchSignIn: e(u),
2049
- onSubmit: B[2] || (B[2] = (F) => e(a)(F))
2050
- }, null, 8, ["size", "loading", "onSwitchSignIn"])) : I("", !0), i(Dt, {
2051
- onToPrivacyPolicy: A,
2052
- onToUserServiceAgreement: C
2053
- })])]));
2054
- }
2055
- }), li = /* @__PURE__ */ q(si, [["__scopeId", "data-v-de36d1d1"]]), oi = {
2056
- class: "header"
2057
- }, ni = ["href"], ri = {
2058
- class: "container"
2059
- }, ui = /* @__PURE__ */ $({
2060
- __name: "AuthkitAuthContainer",
2061
- props: {
2062
- applicationLogoUrl: {
2063
- type: String,
2064
- required: !0,
2065
- default: () => ""
2066
- },
2067
- name: {
2068
- type: String,
2069
- required: !0,
2070
- default: () => ""
2071
- },
2072
- description: {
2073
- type: String,
2074
- required: !0,
2075
- default: () => ""
2076
- },
2077
- appHomePage: {
2078
- type: String,
2079
- required: !0,
2080
- default: () => ""
2081
- },
2082
- backgroundImage: {
2083
- type: String,
2084
- required: !0,
2085
- default: () => ""
2086
- },
2087
- backgroundColor: {
2088
- type: String,
2089
- required: !0,
2090
- default: () => ""
2091
- },
2092
- linkColor: {
2093
- type: String,
2094
- default: "var(--huyooo-accent-primary)"
2095
- },
2096
- backgroundType: {
2097
- type: String,
2098
- default: "color"
2099
- }
2100
- },
2101
- setup(p) {
2102
- const m = p, n = O(() => m.backgroundType === "color" ? {
2103
- backgroundColor: m.backgroundColor
2104
- } : {
2105
- backgroundImage: `url(${m.backgroundImage})`
2106
- });
2107
- return (l, r) => (g(), V("div", {
2108
- class: "auth",
2109
- style: Z(n.value)
2110
- }, [h("div", oi, [m.name ? (g(), V("a", {
2111
- key: 0,
2112
- href: m.appHomePage,
2113
- target: "_self",
2114
- class: "link",
2115
- style: Z({
2116
- color: m.linkColor
2117
- })
2118
- }, " 返回主页 ", 12, ni)) : I("", !0)]), h("div", ri, [ee(l.$slots, "default", {}, void 0, !0)])], 4));
2119
- }
2120
- }), pa = /* @__PURE__ */ q(ui, [["__scopeId", "data-v-0e13d3ff"]]), di = /* @__PURE__ */ $({
2121
- __name: "AuthkitAuthModal",
2122
- props: {
2123
- size: {
2124
- default: "large"
2125
- }
2126
- },
2127
- emits: ["close", "toPrivacyPolicy", "toUserServiceAgreement"],
2128
- setup(p, {
2129
- emit: m
2130
- }) {
2131
- const n = m, {
2132
- onSignIn: l
2133
- } = X(), {
2134
- isOpen: r,
2135
- close: d
2136
- } = qe();
2137
- let a = null;
2138
- W(() => {
2139
- a = l(() => d());
2140
- }), ue(() => {
2141
- a == null || a(), a = null;
2142
- });
2143
- function t(c) {
2144
- c || d();
2145
- }
2146
- function y() {
2147
- d(), n("close");
2148
- }
2149
- return (c, v) => (g(), k(e(ve), {
2150
- visible: e(r),
2151
- footer: !1,
2152
- "mask-closable": !1,
2153
- "title-align": "center",
2154
- "unmount-on-close": "",
2155
- width: "auto",
2156
- "modal-class": "SignInModalClass",
2157
- "onUpdate:visible": t,
2158
- onClose: y
2159
- }, {
2160
- title: s(() => [i(we)]),
2161
- default: s(() => [i(li, {
2162
- "show-title": !1,
2163
- size: p.size,
2164
- onToPrivacyPolicy: v[0] || (v[0] = (f) => n("toPrivacyPolicy")),
2165
- onToUserServiceAgreement: v[1] || (v[1] = (f) => n("toUserServiceAgreement"))
2166
- }, null, 8, ["size"])]),
2167
- _: 1
2168
- }, 8, ["visible"]));
2169
- }
2170
- }), va = /* @__PURE__ */ q(di, [["__scopeId", "data-v-e2b88450"]]), ci = {
2171
- class: "box"
2172
- }, mi = {
2173
- class: "title"
2174
- }, fi = {
2175
- class: "content"
2176
- }, pi = {
2177
- class: "redirect"
2178
- }, vi = {
2179
- style: {
2180
- "font-weight": "bold",
2181
- "font-size": "12px"
2182
- }
2183
- }, gi = /* @__PURE__ */ $({
2184
- __name: "AuthkitAuthorize",
2185
- props: {
2186
- size: {
2187
- type: String,
2188
- required: !0
2189
- },
2190
- title: {
2191
- type: String,
2192
- required: !0,
2193
- default: () => "授权登录"
2194
- },
2195
- logo: {
2196
- type: String,
2197
- required: !0,
2198
- default: () => ""
2199
- },
2200
- clientId: {
2201
- type: String,
2202
- required: !0,
2203
- default: () => ""
2204
- },
2205
- responseType: {
2206
- type: String,
2207
- required: !0,
2208
- default: () => ""
2209
- },
2210
- scope: {
2211
- type: String,
2212
- required: !0,
2213
- default: () => ""
2214
- },
2215
- state: {
2216
- type: String,
2217
- required: !0,
2218
- default: () => ""
2219
- },
2220
- redirectUri: {
2221
- type: String,
2222
- required: !0,
2223
- default: () => ""
2224
- },
2225
- userInfo: {
2226
- type: Object,
2227
- required: !0,
2228
- default: () => ""
2229
- }
2230
- },
2231
- setup(p) {
2232
- const m = w(!1), n = p, l = w({
2233
- appKey: "",
2234
- name: "",
2235
- homePageUrl: "",
2236
- createAt: "",
2237
- authorizationCallback: ""
2238
- });
2239
- async function r() {
2240
- const {
2241
- data: a
2242
- } = await R.apps.findOne.post({
2243
- id: n.clientId
2244
- });
2245
- a && (l.value = a);
2246
- }
2247
- r();
2248
- async function d() {
2249
- m.value = !0;
2250
- const {
2251
- data: a
2252
- } = await R.oauth2.authorize.post({
2253
- client_id: n.clientId,
2254
- response_type: n.responseType,
2255
- scope: n.scope,
2256
- state: n.state,
2257
- redirect_uri: n.redirectUri
2258
- });
2259
- m.value = !1, a && (window.location = a.authorizeUrl);
2260
- }
2261
- return (a, t) => (g(), V("div", ci, [h("div", mi, T(`授权 ${l.value.name}`), 1), h("div", fi, [i(e(Ue), null, {
2262
- default: s(() => [i(e(le), null, {
2263
- default: s(() => {
2264
- var y;
2265
- return [i(e(oe), {
2266
- title: l.value.name,
2267
- description: `想要使用您的${(y = n.userInfo) == null ? void 0 : y.nickname}账户`
2268
- }, {
2269
- avatar: s(() => {
2270
- var c;
2271
- return [i(e(K), {
2272
- shape: "square",
2273
- "image-url": (c = n.userInfo) == null ? void 0 : c.avatar
2274
- }, null, 8, ["image-url"])];
2275
- }),
2276
- _: 1
2277
- }, 8, ["title", "description"])];
2278
- }),
2279
- _: 1
2280
- }), i(e(le), null, {
2281
- default: s(() => [i(e(oe), {
2282
- title: "公开信息",
2283
- description: "头像、昵称"
2284
- }, {
2285
- avatar: s(() => [i(e(K), {
2286
- shape: "square"
2287
- }, {
2288
- default: s(() => [...t[0] || (t[0] = [h("img", {
2289
- alt: "avatar",
2290
- src: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp"
2291
- }, null, -1)])]),
2292
- _: 1
2293
- })]),
2294
- _: 1
2295
- })]),
2296
- _: 1
2297
- }), i(e(le), null, {
2298
- default: s(() => [i(e(oe), {
2299
- title: "个人用户数据",
2300
- description: "电子邮件地址"
2301
- }, {
2302
- avatar: s(() => [i(e(K), {
2303
- shape: "square"
2304
- }, {
2305
- default: s(() => [...t[1] || (t[1] = [h("img", {
2306
- alt: "avatar",
2307
- src: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp"
2308
- }, null, -1)])]),
2309
- _: 1
2310
- })]),
2311
- _: 1
2312
- })]),
2313
- _: 1
2314
- })]),
2315
- _: 1
2316
- }), i(e(U), {
2317
- type: "primary",
2318
- size: n.size,
2319
- loading: m.value,
2320
- onClick: d
2321
- }, {
2322
- default: s(() => [...t[2] || (t[2] = [b(" 授权 ", -1)])]),
2323
- _: 1
2324
- }, 8, ["size", "loading"]), h("div", pi, [t[3] || (t[3] = h("div", {
2325
- class: "redirect-hint"
2326
- }, "授权后将跳转至", -1)), h("div", vi, T(l.value.authorizationCallback), 1)])])]));
2327
- }
2328
- }), ga = /* @__PURE__ */ q(gi, [["__scopeId", "data-v-5665e1c4"]]), yi = {
2329
- class: "oauth-callback"
2330
- }, hi = {
2331
- key: 0,
2332
- class: "callback-loading"
2333
- }, _i = {
2334
- key: 1,
2335
- class: "callback-error"
2336
- }, wi = {
2337
- key: 2,
2338
- class: "callback-success"
2339
- }, bi = /* @__PURE__ */ $({
2340
- __name: "AuthkitOauthCallback",
2341
- props: {
2342
- defaultRedirect: {},
2343
- loadingText: {},
2344
- bindIdentityRedirect: {}
2345
- },
2346
- emits: ["success", "error", "needBindIdentity"],
2347
- setup(p, {
2348
- emit: m
2349
- }) {
2350
- const n = p, l = m, r = w(!0), d = w(""), {
2351
- setToken: a,
2352
- restoreSession: t
2353
- } = X(), {
2354
- fetchUserProfile: y
2355
- } = Q();
2356
- async function c() {
2357
- const f = new URLSearchParams(window.location.search), o = f.get("error");
2358
- if (o) {
2359
- d.value = decodeURIComponent(o), r.value = !1, l("error", d.value);
2360
- return;
2361
- }
2362
- const u = f.get("token"), _ = f.get("userId"), A = f.get("appId"), C = f.get("needBindIdentity") === "true";
2363
- if (!u) {
2364
- d.value = "登录失败:未收到认证令牌", r.value = !1, l("error", d.value);
2365
- return;
2366
- }
2367
- try {
2368
- a(u), await y();
2369
- const x = window.location.pathname;
2370
- if (window.history.replaceState({}, "", x), C && (l("needBindIdentity", {
2371
- token: u,
2372
- userId: _ || "",
2373
- appId: A || ""
2374
- }), n.bindIdentityRedirect)) {
2375
- r.value = !1, setTimeout(() => {
2376
- window.location.href = n.bindIdentityRedirect;
2377
- }, 300);
2378
- return;
2379
- }
2380
- l("success", {
2381
- token: u,
2382
- userId: _ || "",
2383
- appId: A || "",
2384
- needBindIdentity: C
2385
- });
2386
- const B = sessionStorage.getItem("auth_redirect");
2387
- sessionStorage.removeItem("auth_redirect");
2388
- const F = B || n.defaultRedirect || "/";
2389
- r.value = !1, setTimeout(() => {
2390
- window.location.href = F;
2391
- }, 500);
2392
- } catch (x) {
2393
- console.error("OAuth 回调处理失败:", x), d.value = "登录处理失败,请重试", r.value = !1, l("error", d.value);
2394
- }
2395
- }
2396
- function v() {
2397
- const f = sessionStorage.getItem("auth_redirect");
2398
- sessionStorage.removeItem("auth_redirect"), window.location.href = f || n.defaultRedirect || "/";
2399
- }
2400
- return W(() => {
2401
- const f = new URLSearchParams(window.location.search);
2402
- if (f.has("token") || f.has("error"))
2403
- c();
2404
- else if (t()) {
2405
- const o = sessionStorage.getItem("auth_redirect");
2406
- sessionStorage.removeItem("auth_redirect"), window.location.href = o || n.defaultRedirect || "/";
2407
- } else
2408
- d.value = "无效的访问", r.value = !1;
2409
- }), (f, o) => (g(), V("div", yi, [r.value ? (g(), V("div", hi, [o[0] || (o[0] = h("div", {
2410
- class: "spinner"
2411
- }, null, -1)), h("p", null, T(p.loadingText), 1)])) : d.value ? (g(), V("div", _i, [o[1] || (o[1] = h("div", {
2412
- class: "error-icon"
2413
- }, "✕", -1)), o[2] || (o[2] = h("h2", null, "登录失败", -1)), h("p", null, T(d.value), 1), h("button", {
2414
- class: "retry-btn",
2415
- onClick: v
2416
- }, "返回重试")])) : (g(), V("div", wi, [...o[3] || (o[3] = [h("div", {
2417
- class: "success-icon"
2418
- }, "✓", -1), h("p", null, "登录成功,正在跳转...", -1)])]))]));
2419
- }
2420
- }), ya = /* @__PURE__ */ q(bi, [["__scopeId", "data-v-3a884e7b"]]), ki = {
2421
- class: "BindEmail"
2422
- }, Si = {
2423
- class: "content"
2424
- }, zi = {
2425
- class: "sendVerifyCodeItem"
2426
- }, Ii = {
2427
- class: "handle"
2428
- }, Vi = {
2429
- key: 0,
2430
- class: "skip"
2431
- }, $i = /* @__PURE__ */ $({
2432
- __name: "AuthkitBindEmail",
2433
- props: {
2434
- size: {
2435
- type: String,
2436
- required: !0
2437
- },
2438
- loading: {
2439
- type: Boolean,
2440
- required: !0,
2441
- default: () => !1
2442
- },
2443
- /** 是否显示跳过按钮 */
2444
- showSkip: {
2445
- type: Boolean,
2446
- default: !1
2447
- }
2448
- },
2449
- emits: ["submit", "skip"],
2450
- setup(p, {
2451
- emit: m
2452
- }) {
2453
- const n = m, l = p, r = w(), d = w(!1), a = w(), t = w({
2454
- email: void 0,
2455
- userToken: void 0,
2456
- emailVerifyId: void 0
2457
- });
2458
- async function y() {
2459
- if (!await a.value.validateField(["email"])) {
2460
- d.value = !0;
2461
- const {
2462
- data: o
2463
- } = await R.verify.email.retry.post({
2464
- email: t.value.email
2465
- });
2466
- d.value = !1, o && (t.value.emailVerifyId = o.emailVerifyId, r.value.startCountFn());
2467
- }
2468
- }
2469
- async function c() {
2470
- a.value.validate().then((f) => {
2471
- f || n("submit", {
2472
- email: t.value.email,
2473
- userToken: t.value.userToken,
2474
- emailVerifyId: t.value.emailVerifyId
2475
- });
2476
- });
2477
- }
2478
- function v() {
2479
- n("skip");
2480
- }
2481
- return (f, o) => (g(), V("div", ki, [o[4] || (o[4] = h("div", {
2482
- class: "header"
2483
- }, [h("h3", {
2484
- class: "title"
2485
- }, "绑定邮箱"), h("p", {
2486
- class: "subtitle"
2487
- }, "请绑定邮箱以完成账号设置,绑定后可使用邮箱登录")], -1)), h("div", Si, [i(e(D), {
2488
- ref_key: "formRef",
2489
- ref: a,
2490
- model: t.value,
2491
- size: l.size,
2492
- "auto-label-width": ""
2493
- }, {
2494
- default: s(() => [i(e(z), {
2495
- field: "email",
2496
- label: "邮箱",
2497
- "hide-label": "",
2498
- rules: [{
2499
- required: !0,
2500
- message: "请输入邮箱"
2501
- }, {
2502
- type: "email",
2503
- message: "请输入有效的邮箱"
2504
- }]
2505
- }, {
2506
- default: s(() => [i(e(P), {
2507
- modelValue: t.value.email,
2508
- "onUpdate:modelValue": o[0] || (o[0] = (u) => t.value.email = u),
2509
- placeholder: "请输入邮箱",
2510
- autocomplete: "email",
2511
- type: "email"
2512
- }, null, 8, ["modelValue"])]),
2513
- _: 1
2514
- }), i(e(z), {
2515
- field: "userToken",
2516
- label: "验证码",
2517
- "hide-label": "",
2518
- rules: [{
2519
- required: !0,
2520
- message: "请输入验证码"
2521
- }]
2522
- }, {
2523
- default: s(() => [h("div", zi, [i(e(P), {
2524
- modelValue: t.value.userToken,
2525
- "onUpdate:modelValue": o[1] || (o[1] = (u) => t.value.userToken = u),
2526
- placeholder: "请输入验证码",
2527
- autocomplete: "one-time-code"
2528
- }, null, 8, ["modelValue"]), i(G, {
2529
- ref_key: "SendVerifyCodeRef",
2530
- ref: r,
2531
- size: l.size,
2532
- loading: d.value,
2533
- style: {
2534
- "margin-left": "10px"
2535
- },
2536
- onSend: y
2537
- }, null, 8, ["size", "loading"])])]),
2538
- _: 1
2539
- }), h("div", Ii, [i(e(U), {
2540
- type: "primary",
2541
- loading: l.loading,
2542
- long: "",
2543
- size: l.size,
2544
- onClick: c
2545
- }, {
2546
- default: s(() => [...o[2] || (o[2] = [b(" 绑定邮箱 ", -1)])]),
2547
- _: 1
2548
- }, 8, ["loading", "size"])])]),
2549
- _: 1
2550
- }, 8, ["model", "size"])]), l.showSkip ? (g(), V("div", Vi, [i(e(M), {
2551
- onClick: v
2552
- }, {
2553
- default: s(() => [...o[3] || (o[3] = [b("稍后绑定", -1)])]),
2554
- _: 1
2555
- })])) : I("", !0)]));
2556
- }
2557
- }), ha = /* @__PURE__ */ q($i, [["__scopeId", "data-v-aa10f560"]]), Ai = {
2558
- class: "BindPhone"
2559
- }, Pi = {
2560
- class: "content"
2561
- }, Ci = {
2562
- class: "sendVerifyCodeItem"
2563
- }, Ui = {
2564
- class: "handle"
2565
- }, qi = {
2566
- key: 0,
2567
- class: "skip"
2568
- }, Ri = /* @__PURE__ */ $({
2569
- __name: "AuthkitBindPhone",
2570
- props: {
2571
- size: {
2572
- type: String,
2573
- required: !0
2574
- },
2575
- loading: {
2576
- type: Boolean,
2577
- required: !0,
2578
- default: () => !1
2579
- },
2580
- showSkip: {
2581
- type: Boolean,
2582
- default: !1
2583
- }
2584
- },
2585
- emits: ["submit", "skip"],
2586
- setup(p, {
2587
- emit: m
2588
- }) {
2589
- const n = m, l = p, r = w(), d = w(!1), a = w(), t = w({
2590
- phone: void 0,
2591
- code: void 0
2592
- });
2593
- async function y() {
2594
- if (!await a.value.validateField(["phone"])) {
2595
- d.value = !0;
2596
- const {
2597
- error: o
2598
- } = await R.verify.sms.send.post({
2599
- phone: t.value.phone
2600
- });
2601
- d.value = !1, o || r.value.startCountFn();
2602
- }
2603
- }
2604
- async function c() {
2605
- a.value.validate().then((f) => {
2606
- f || n("submit", {
2607
- phone: t.value.phone,
2608
- code: t.value.code
2609
- });
2610
- });
2611
- }
2612
- function v() {
2613
- n("skip");
2614
- }
2615
- return (f, o) => (g(), V("div", Ai, [o[4] || (o[4] = h("div", {
2616
- class: "header"
2617
- }, [h("h3", {
2618
- class: "title"
2619
- }, "绑定手机号"), h("p", {
2620
- class: "subtitle"
2621
- }, "请绑定手机号以完成账号设置")], -1)), h("div", Pi, [i(e(D), {
2622
- ref_key: "formRef",
2623
- ref: a,
2624
- model: t.value,
2625
- size: l.size,
2626
- "auto-label-width": ""
2627
- }, {
2628
- default: s(() => [i(e(z), {
2629
- field: "phone",
2630
- label: "手机号",
2631
- "hide-label": "",
2632
- rules: [{
2633
- required: !0,
2634
- message: "请输入手机号"
2635
- }, {
2636
- match: /^1[3-9]\d{9}$/,
2637
- message: "请输入有效的手机号"
2638
- }]
2639
- }, {
2640
- default: s(() => [i(e(P), {
2641
- modelValue: t.value.phone,
2642
- "onUpdate:modelValue": o[0] || (o[0] = (u) => t.value.phone = u),
2643
- placeholder: "请输入手机号",
2644
- autocomplete: "tel",
2645
- type: "tel"
2646
- }, null, 8, ["modelValue"])]),
2647
- _: 1
2648
- }), i(e(z), {
2649
- field: "code",
2650
- label: "验证码",
2651
- "hide-label": "",
2652
- rules: [{
2653
- required: !0,
2654
- message: "请输入验证码"
2655
- }]
2656
- }, {
2657
- default: s(() => [h("div", Ci, [i(e(P), {
2658
- modelValue: t.value.code,
2659
- "onUpdate:modelValue": o[1] || (o[1] = (u) => t.value.code = u),
2660
- placeholder: "请输入验证码",
2661
- autocomplete: "one-time-code"
2662
- }, null, 8, ["modelValue"]), i(G, {
2663
- ref_key: "SendVerifyCodeRef",
2664
- ref: r,
2665
- size: l.size,
2666
- loading: d.value,
2667
- style: {
2668
- "margin-left": "10px"
2669
- },
2670
- onSend: y
2671
- }, null, 8, ["size", "loading"])])]),
2672
- _: 1
2673
- }), h("div", Ui, [i(e(U), {
2674
- type: "primary",
2675
- loading: l.loading,
2676
- long: "",
2677
- size: l.size,
2678
- onClick: c
2679
- }, {
2680
- default: s(() => [...o[2] || (o[2] = [b(" 绑定手机号 ", -1)])]),
2681
- _: 1
2682
- }, 8, ["loading", "size"])])]),
2683
- _: 1
2684
- }, 8, ["model", "size"])]), l.showSkip ? (g(), V("div", qi, [i(e(M), {
2685
- onClick: v
2686
- }, {
2687
- default: s(() => [...o[3] || (o[3] = [b("稍后绑定", -1)])]),
2688
- _: 1
2689
- })])) : I("", !0)]));
2690
- }
2691
- }), _a = /* @__PURE__ */ q(Ri, [["__scopeId", "data-v-d6436fba"]]), xi = {
2692
- class: "SignUpPhone"
2693
- }, Ti = {
2694
- class: "content"
2695
- }, Bi = {
2696
- class: "sendVerifyCodeItem"
2697
- }, Li = {
2698
- class: "handle"
2699
- }, Oi = /* @__PURE__ */ $({
2700
- __name: "AuthkitSignUpPhone",
2701
- props: {
2702
- size: {
2703
- type: String,
2704
- required: !0
2705
- },
2706
- loading: {
2707
- type: Boolean,
2708
- required: !0,
2709
- default: () => !1
2710
- },
2711
- /** 是否要求设置密码 */
2712
- requirePassword: {
2713
- type: Boolean,
2714
- default: !1
2715
- }
2716
- },
2717
- emits: ["switchSignIn", "submit"],
2718
- setup(p, {
2719
- emit: m
2720
- }) {
2721
- const n = m, l = p, r = w(), d = w(!1), a = w(), t = w({
2722
- phone: void 0,
2723
- code: void 0,
2724
- password: void 0,
2725
- confirmPassword: void 0,
2726
- referrerId: void 0
2727
- }), y = [{
2728
- required: !0,
2729
- message: "请输入确认密码"
2730
- }, {
2731
- validator: (o, u) => {
2732
- t.value.password && o !== t.value.password ? u("两次密码输入不一致") : u();
2733
- }
2734
- }];
2735
- function c() {
2736
- n("switchSignIn");
2737
- }
2738
- async function v() {
2739
- if (!await a.value.validateField(["phone"])) {
2740
- d.value = !0;
2741
- const {
2742
- error: u
2743
- } = await R.verify.sms.send.post({
2744
- phone: t.value.phone
2745
- });
2746
- d.value = !1, u || r.value.startCountFn();
2747
- }
2748
- }
2749
- async function f() {
2750
- a.value.validate().then((o) => {
2751
- o || n("submit", {
2752
- phone: t.value.phone,
2753
- code: t.value.code,
2754
- password: t.value.password,
2755
- referrerId: t.value.referrerId
2756
- });
2757
- });
2758
- }
2759
- return (o, u) => (g(), V("div", xi, [h("div", Ti, [i(e(D), {
2760
- ref_key: "formRef",
2761
- ref: a,
2762
- model: t.value,
2763
- size: l.size,
2764
- "auto-label-width": ""
2765
- }, {
2766
- default: s(() => [i(e(z), {
2767
- field: "phone",
2768
- label: "手机号",
2769
- "hide-label": "",
2770
- rules: [{
2771
- required: !0,
2772
- message: "请输入手机号"
2773
- }, {
2774
- match: /^1[3-9]\d{9}$/,
2775
- message: "请输入有效的手机号"
2776
- }]
2777
- }, {
2778
- default: s(() => [i(e(P), {
2779
- modelValue: t.value.phone,
2780
- "onUpdate:modelValue": u[0] || (u[0] = (_) => t.value.phone = _),
2781
- placeholder: "请输入手机号",
2782
- autocomplete: "tel",
2783
- type: "tel"
2784
- }, null, 8, ["modelValue"])]),
2785
- _: 1
2786
- }), i(e(z), {
2787
- field: "code",
2788
- label: "验证码",
2789
- "hide-label": "",
2790
- rules: [{
2791
- required: !0,
2792
- message: "请输入验证码"
2793
- }]
2794
- }, {
2795
- default: s(() => [h("div", Bi, [i(e(P), {
2796
- modelValue: t.value.code,
2797
- "onUpdate:modelValue": u[1] || (u[1] = (_) => t.value.code = _),
2798
- placeholder: "请输入验证码",
2799
- autocomplete: "one-time-code"
2800
- }, null, 8, ["modelValue"]), i(G, {
2801
- ref_key: "SendVerifyCodeRef",
2802
- ref: r,
2803
- size: l.size,
2804
- loading: d.value,
2805
- style: {
2806
- "margin-left": "10px"
2807
- },
2808
- onSend: v
2809
- }, null, 8, ["size", "loading"])])]),
2810
- _: 1
2811
- }), l.requirePassword ? (g(), k(e(z), {
2812
- key: 0,
2813
- field: "password",
2814
- label: "密码",
2815
- "hide-label": "",
2816
- rules: [{
2817
- required: l.requirePassword,
2818
- message: "密码请输入"
2819
- }, {
2820
- minLength: 10,
2821
- message: "密码不能少于10字符"
2822
- }]
2823
- }, {
2824
- default: s(() => [i(e(P), {
2825
- modelValue: t.value.password,
2826
- "onUpdate:modelValue": u[2] || (u[2] = (_) => t.value.password = _),
2827
- placeholder: "请输入密码(可选)",
2828
- type: "password",
2829
- autocomplete: "new-password"
2830
- }, null, 8, ["modelValue"])]),
2831
- _: 1
2832
- }, 8, ["rules"])) : I("", !0), l.requirePassword && t.value.password ? (g(), k(e(z), {
2833
- key: 1,
2834
- field: "confirmPassword",
2835
- label: "确认密码",
2836
- "hide-label": "",
2837
- rules: y
2838
- }, {
2839
- default: s(() => [i(e(P), {
2840
- modelValue: t.value.confirmPassword,
2841
- "onUpdate:modelValue": u[3] || (u[3] = (_) => t.value.confirmPassword = _),
2842
- placeholder: "请输入确认密码",
2843
- type: "password",
2844
- autocomplete: "new-password"
2845
- }, null, 8, ["modelValue"])]),
2846
- _: 1
2847
- })) : I("", !0), i(e(z), {
2848
- field: "referrerId",
2849
- label: "邀请人",
2850
- "hide-label": "",
2851
- rules: [{
2852
- required: !1
2853
- }]
2854
- }, {
2855
- default: s(() => [i(e(P), {
2856
- modelValue: t.value.referrerId,
2857
- "onUpdate:modelValue": u[4] || (u[4] = (_) => t.value.referrerId = _),
2858
- placeholder: "邀请人ID(可选)",
2859
- autocomplete: "off"
2860
- }, null, 8, ["modelValue"])]),
2861
- _: 1
2862
- }), h("div", Li, [i(e(U), {
2863
- type: "primary",
2864
- loading: l.loading,
2865
- long: "",
2866
- size: l.size,
2867
- onClick: f
2868
- }, {
2869
- default: s(() => [...u[5] || (u[5] = [b(" 注册 ", -1)])]),
2870
- _: 1
2871
- }, 8, ["loading", "size"])])]),
2872
- _: 1
2873
- }, 8, ["model", "size"])]), i(me, {
2874
- onSwitchSignIn: c
2875
- })]));
2876
- }
2877
- }), wa = /* @__PURE__ */ q(Oi, [["__scopeId", "data-v-1f2f8707"]]), Fi = {
2878
- class: "SignInPhone"
2879
- }, Ei = {
2880
- class: "content"
2881
- }, Di = {
2882
- class: "sendVerifyCodeItem"
2883
- }, Ni = {
2884
- class: "handle"
2885
- }, Hi = /* @__PURE__ */ $({
2886
- __name: "AuthkitSignInPhone",
2887
- props: {
2888
- size: {
2889
- type: String,
2890
- required: !0
2891
- },
2892
- loading: {
2893
- type: Boolean,
2894
- required: !0,
2895
- default: () => !1
2896
- }
2897
- },
2898
- emits: ["submit", "switchSignUp", "switchResetPassword"],
2899
- setup(p, {
2900
- emit: m
2901
- }) {
2902
- const n = m, l = p, r = pe(), d = O(() => !!r.OAuth), a = w(), t = w(!1), y = w(), c = w({
2903
- phone: void 0,
2904
- code: void 0
2905
- });
2906
- function v() {
2907
- n("switchSignUp");
2908
- }
2909
- function f() {
2910
- n("switchResetPassword");
2911
- }
2912
- async function o() {
2913
- if (!await y.value.validateField(["phone"])) {
2914
- t.value = !0;
2915
- const {
2916
- error: A
2917
- } = await R.verify.sms.send.post({
2918
- phone: c.value.phone
2919
- });
2920
- t.value = !1, A || a.value.startCountFn();
2921
- }
2922
- }
2923
- async function u() {
2924
- y.value.validate().then((_) => {
2925
- _ || n("submit", {
2926
- identifier: c.value.phone,
2927
- code: c.value.code,
2928
- method: "code"
2929
- });
2930
- });
2931
- }
2932
- return (_, A) => (g(), V("div", Fi, [h("div", Ei, [i(e(D), {
2933
- ref_key: "formRef",
2934
- ref: y,
2935
- model: c.value,
2936
- size: l.size,
2937
- "auto-label-width": ""
2938
- }, {
2939
- default: s(() => [i(e(z), {
2940
- field: "phone",
2941
- label: "手机号",
2942
- "hide-label": "",
2943
- rules: [{
2944
- required: !0,
2945
- message: "请输入手机号"
2946
- }, {
2947
- match: /^1[3-9]\d{9}$/,
2948
- message: "请输入有效的手机号"
2949
- }]
2950
- }, {
2951
- default: s(() => [i(e(P), {
2952
- modelValue: c.value.phone,
2953
- "onUpdate:modelValue": A[0] || (A[0] = (C) => c.value.phone = C),
2954
- placeholder: "请输入手机号",
2955
- autocomplete: "tel",
2956
- type: "tel"
2957
- }, null, 8, ["modelValue"])]),
2958
- _: 1
2959
- }), i(e(z), {
2960
- field: "code",
2961
- label: "验证码",
2962
- "hide-label": "",
2963
- rules: [{
2964
- required: !0,
2965
- message: "请输入验证码"
2966
- }]
2967
- }, {
2968
- default: s(() => [h("div", Di, [i(e(P), {
2969
- modelValue: c.value.code,
2970
- "onUpdate:modelValue": A[1] || (A[1] = (C) => c.value.code = C),
2971
- placeholder: "请输入验证码",
2972
- autocomplete: "one-time-code"
2973
- }, null, 8, ["modelValue"]), i(G, {
2974
- ref_key: "SendVerifyCodeRef",
2975
- ref: a,
2976
- size: l.size,
2977
- loading: t.value,
2978
- style: {
2979
- "margin-left": "10px"
2980
- },
2981
- onSend: o
2982
- }, null, 8, ["size", "loading"])])]),
2983
- _: 1
2984
- }), h("div", Ni, [i(e(U), {
2985
- type: "primary",
2986
- loading: l.loading,
2987
- long: "",
2988
- size: l.size,
2989
- onClick: u
2990
- }, {
2991
- default: s(() => [...A[2] || (A[2] = [b(" 登录 ", -1)])]),
2992
- _: 1
2993
- }, 8, ["loading", "size"])])]),
2994
- _: 1
2995
- }, 8, ["model", "size"])]), d.value ? ee(_.$slots, "OAuth", {
2996
- key: 0
2997
- }, void 0, !0) : I("", !0), i(_e, {
2998
- onSwitchSignUp: v,
2999
- onSwitchResetPassword: f
3000
- })]));
3001
- }
3002
- }), ba = /* @__PURE__ */ q(Hi, [["__scopeId", "data-v-6c74668e"]]);
3003
- export {
3004
- fa as A,
3005
- nt as E,
3006
- $t as O,
3007
- Gt as P,
3008
- Lt as R,
3009
- G as S,
3010
- rt as _,
3011
- li as a,
3012
- pa as b,
3013
- va as c,
3014
- we as d,
3015
- ga as e,
3016
- ha as f,
3017
- _a as g,
3018
- ye as h,
3019
- ce as i,
3020
- ya as j,
3021
- re as k,
3022
- et as l,
3023
- qt as m,
3024
- We as n,
3025
- Dt as o,
3026
- tt as p,
3027
- Jt as q,
3028
- ba as r,
3029
- Yt as s,
3030
- wa as t,
3031
- me as u,
3032
- _e as v,
3033
- St as w
3034
- };