@huyooo/ui 0.5.54 → 0.5.58

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.
@@ -0,0 +1,2133 @@
1
+ /* empty css */
2
+ /* empty css */
3
+ /* empty css */
4
+ import { defineComponent as I, computed as G, createElementBlock as P, openBlock as g, normalizeStyle as ie, normalizeClass as we, createElementVNode as z, ref as _, createBlock as k, unref as e, withCtx as s, createVNode as i, createTextVNode as w, onMounted as K, onUnmounted as oe, withDirectives as be, toDisplayString as R, vShow as ke, Fragment as F, createCommentVNode as S, renderList as ze, isRef as re, useSlots as Se, renderSlot as ue } from "vue";
5
+ import { Form as H, FormItem as A, Avatar as de, Input as q, Textarea as Ae, Button as V, Message as D, Alert as E, Space as Y, InputPassword as Ie, Result as Ve, Modal as me, Divider as Pe, Link as M } from "@arco-design/web-vue";
6
+ /* empty css */
7
+ import { g as N, c as Z, h as ce, u as Ue } from "./auth-CDARHcht.js";
8
+ /* empty css */
9
+ import { u as Ce } from "./useUploadCos-DKh-eczm.js";
10
+ import { b as $e, c as ae, d as xe, a as J, e as qe, f as Te, u as Q, g as Re, h as Le } from "./useAuthkitUsersProfile-B_uMdnat.js";
11
+ import { _ as Be, g as Oe, i as Ee } from "./plugin-vue_export-helper-LjDO2Zua.js";
12
+ import { _ as $ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
+ import { M as De } from "./Menu-BjWB9hre.js";
14
+ import { u as Ge } from "./useAuthkitCreateAndUpdate-Bsl_uyGQ.js";
15
+ import { u as le } from "./useAuthkitAppsAuthPageInfo-h9CL-MmH.js";
16
+ /* empty css */
17
+ import { Icon as He } from "@iconify/vue";
18
+ const Ne = I({
19
+ name: "IconCamera",
20
+ props: {
21
+ size: {
22
+ type: [Number, String]
23
+ },
24
+ strokeWidth: {
25
+ type: Number,
26
+ default: 4
27
+ },
28
+ strokeLinecap: {
29
+ type: String,
30
+ default: "butt",
31
+ validator: (u) => ["butt", "round", "square"].includes(u)
32
+ },
33
+ strokeLinejoin: {
34
+ type: String,
35
+ default: "miter",
36
+ validator: (u) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(u)
37
+ },
38
+ rotate: Number,
39
+ spin: Boolean
40
+ },
41
+ emits: {
42
+ click: (u) => !0
43
+ },
44
+ setup(u, {
45
+ emit: o
46
+ }) {
47
+ const a = Oe("icon"), n = G(() => [a, `${a}-camera`, {
48
+ [`${a}-spin`]: u.spin
49
+ }]), r = G(() => {
50
+ const t = {};
51
+ return u.size && (t.fontSize = Ee(u.size) ? `${u.size}px` : u.size), u.rotate && (t.transform = `rotate(${u.rotate}deg)`), t;
52
+ });
53
+ return {
54
+ cls: n,
55
+ innerStyle: r,
56
+ onClick: (t) => {
57
+ o("click", t);
58
+ }
59
+ };
60
+ }
61
+ }), Fe = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
62
+ function Me(u, o, a, n, r, m) {
63
+ return g(), P("svg", {
64
+ viewBox: "0 0 48 48",
65
+ fill: "none",
66
+ xmlns: "http://www.w3.org/2000/svg",
67
+ stroke: "currentColor",
68
+ class: we(u.cls),
69
+ style: ie(u.innerStyle),
70
+ "stroke-width": u.strokeWidth,
71
+ "stroke-linecap": u.strokeLinecap,
72
+ "stroke-linejoin": u.strokeLinejoin,
73
+ onClick: o[0] || (o[0] = (...t) => u.onClick && u.onClick(...t))
74
+ }, o[1] || (o[1] = [z("path", {
75
+ 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"
76
+ }, null, -1)]), 14, Fe);
77
+ }
78
+ var ee = /* @__PURE__ */ Be(Ne, [["render", Me]]);
79
+ const je = Object.assign(ee, {
80
+ install: (u, o) => {
81
+ var a;
82
+ const n = (a = o == null ? void 0 : o.iconPrefix) != null ? a : "";
83
+ u.component(n + ee.name, ee);
84
+ }
85
+ }), We = {
86
+ class: "handle"
87
+ }, Ke = /* @__PURE__ */ I({
88
+ __name: "AuthkitPersonalInformation",
89
+ props: {
90
+ size: {
91
+ type: String,
92
+ required: !0
93
+ }
94
+ },
95
+ emits: ["submit"],
96
+ setup(u, {
97
+ emit: o
98
+ }) {
99
+ const a = o, n = u, r = _({
100
+ id: void 0,
101
+ nickname: "",
102
+ description: "",
103
+ avatar: "",
104
+ avatarUrl: ""
105
+ }), m = _(!1), t = _(), l = _(!1);
106
+ function y() {
107
+ l.value = !0, $e().then(({
108
+ data: d
109
+ }) => {
110
+ l.value = !1, r.value.id = d.id, r.value.nickname = d.nickname, r.value.description = d.description, r.value.avatar = d.avatar, r.value.avatarUrl = d.avatarUrl;
111
+ }).catch(() => {
112
+ l.value = !1;
113
+ });
114
+ }
115
+ function f() {
116
+ t.value.validate().then((d) => {
117
+ if (!d) {
118
+ l.value = !0;
119
+ const c = {
120
+ id: r.value.id,
121
+ nickname: r.value.nickname,
122
+ description: r.value.description,
123
+ avatar: r.value.avatar
124
+ };
125
+ ae(c).then(({
126
+ data: v
127
+ }) => {
128
+ l.value = !1, D.success("更新成功"), r.value.avatarUrl = v.avatarUrl, a("submit");
129
+ }).catch(() => {
130
+ l.value = !1;
131
+ });
132
+ }
133
+ });
134
+ }
135
+ y();
136
+ const p = () => {
137
+ const {
138
+ uploadFile: d
139
+ } = Ce(), c = document.createElement("input");
140
+ c.type = "file", c.accept = "image/*", c.style.display = "none", document.body.append(c), c.addEventListener("change", async (v) => {
141
+ var C;
142
+ const U = (C = v.target.files) == null ? void 0 : C[0];
143
+ if (U) {
144
+ m.value = !0;
145
+ try {
146
+ d({
147
+ bucketId: N.avatarBucketId,
148
+ file: U,
149
+ onFileFinish(T, B, O) {
150
+ m.value = !0;
151
+ const j = {
152
+ id: r.value.id,
153
+ nickname: r.value.nickname,
154
+ description: r.value.description,
155
+ avatar: O.Key
156
+ };
157
+ ae(j).then(() => {
158
+ m.value = !1, D.success("更新成功"), y(), a("submit");
159
+ }).catch(() => {
160
+ m.value = !1;
161
+ });
162
+ },
163
+ onError(T) {
164
+ console.error("上传图片失败"), m.value = !1;
165
+ }
166
+ });
167
+ } catch (T) {
168
+ console.error("上传图片失败", T), m.value = !1;
169
+ }
170
+ }
171
+ c.remove();
172
+ }), c.click();
173
+ };
174
+ return (d, c) => (g(), k(e(H), {
175
+ ref_key: "formRef",
176
+ ref: t,
177
+ model: r.value,
178
+ "auto-label-width": "",
179
+ size: n.size
180
+ }, {
181
+ default: s(() => [i(e(A), {
182
+ field: "avatar",
183
+ label: "头像",
184
+ rules: [{
185
+ required: !1,
186
+ message: "请上传头像"
187
+ }]
188
+ }, {
189
+ default: s(() => [i(e(de), {
190
+ "image-url": r.value.avatarUrl,
191
+ size: 42,
192
+ "object-fit": "cover",
193
+ "trigger-icon-style": {
194
+ color: "#3491FA"
195
+ },
196
+ onClick: p
197
+ }, {
198
+ "trigger-icon": s(() => [i(e(je))]),
199
+ _: 1
200
+ }, 8, ["image-url"])]),
201
+ _: 1
202
+ }), i(e(A), {
203
+ field: "nickname",
204
+ label: "昵称",
205
+ rules: [{
206
+ required: !1,
207
+ message: "请输入昵称"
208
+ }]
209
+ }, {
210
+ default: s(() => [i(e(q), {
211
+ modelValue: r.value.nickname,
212
+ "onUpdate:modelValue": c[0] || (c[0] = (v) => r.value.nickname = v),
213
+ placeholder: "请输入昵称"
214
+ }, null, 8, ["modelValue"])]),
215
+ _: 1
216
+ }), i(e(A), {
217
+ field: "description",
218
+ label: "简介",
219
+ rules: [{
220
+ required: !1,
221
+ message: "请输入描述"
222
+ }]
223
+ }, {
224
+ default: s(() => [i(e(Ae), {
225
+ modelValue: r.value.description,
226
+ "onUpdate:modelValue": c[1] || (c[1] = (v) => r.value.description = v),
227
+ placeholder: "请输入描述",
228
+ "allow-clear": "",
229
+ "auto-size": {
230
+ minRows: 5
231
+ }
232
+ }, null, 8, ["modelValue"])]),
233
+ _: 1
234
+ }), i(e(A), {
235
+ field: "",
236
+ label: "",
237
+ rules: []
238
+ }, {
239
+ default: s(() => [z("div", We, [i(e(V), {
240
+ type: "primary",
241
+ loading: l.value,
242
+ onClick: f
243
+ }, {
244
+ default: s(() => [...c[2] || (c[2] = [w(" 提交 ", -1)])]),
245
+ _: 1
246
+ }, 8, ["loading"])])]),
247
+ _: 1
248
+ })]),
249
+ _: 1
250
+ }, 8, ["model", "size"]));
251
+ }
252
+ }), Ze = /* @__PURE__ */ $(Ke, [["__scopeId", "data-v-c241b7f8"]]);
253
+ function Je(u) {
254
+ return Z({
255
+ url: `${N.authPrefixUrl}/restfulApi/verify/email`,
256
+ method: "post",
257
+ data: u
258
+ });
259
+ }
260
+ function X(u) {
261
+ return Z({
262
+ url: `${N.authPrefixUrl}/restfulApi/verify/email/retry`,
263
+ method: "post",
264
+ data: u
265
+ });
266
+ }
267
+ function Qe(u) {
268
+ return Z({
269
+ url: `${N.authPrefixUrl}/restfulApi/verify/password`,
270
+ method: "post",
271
+ data: u
272
+ });
273
+ }
274
+ const Xe = /* @__PURE__ */ I({
275
+ __name: "AuthkitSendVerifyCode",
276
+ props: {
277
+ size: {
278
+ type: String,
279
+ required: !0
280
+ },
281
+ loading: {
282
+ type: Boolean,
283
+ required: !0,
284
+ default: () => !1
285
+ }
286
+ },
287
+ emits: ["send"],
288
+ setup(u, {
289
+ expose: o,
290
+ emit: a
291
+ }) {
292
+ const n = a, r = u, m = _(!1);
293
+ let t;
294
+ const l = _(0), y = G(() => l.value.toString().padStart(2, "0")), f = G(() => l.value > 0), p = () => {
295
+ m.value && (l.value <= 0 ? (clearInterval(t), m.value = !1) : l.value--);
296
+ };
297
+ function d() {
298
+ n("send");
299
+ }
300
+ function c() {
301
+ l.value = 60, m.value = !0, t && clearInterval(t), t = setInterval(p, 1e3);
302
+ }
303
+ return K(() => {
304
+ }), o({
305
+ startCountFn: c
306
+ }), oe(() => {
307
+ t && clearInterval(t);
308
+ }), (v, b) => (g(), k(e(V), {
309
+ class: "OAuthItem",
310
+ type: "primary",
311
+ size: r.size,
312
+ disabled: f.value,
313
+ loading: r.loading,
314
+ onClick: d
315
+ }, {
316
+ default: s(() => [b[0] || (b[0] = z("span", null, " 发送验证码", -1)), be(z("span", {
317
+ class: "verify-code-timer"
318
+ }, R(`(${y.value})`), 513), [[ke, f.value]])]),
319
+ _: 1
320
+ }, 8, ["size", "disabled", "loading"]));
321
+ }
322
+ }), se = /* @__PURE__ */ $(Xe, [["__scopeId", "data-v-2883dc6d"]]), Ye = {
323
+ class: "sendVerifyCodeItem"
324
+ }, et = {
325
+ class: "handle"
326
+ }, tt = /* @__PURE__ */ I({
327
+ __name: "AuthkitEmailVerify",
328
+ props: {
329
+ email: {
330
+ type: String,
331
+ required: !0,
332
+ default: () => ""
333
+ },
334
+ size: {
335
+ type: String,
336
+ required: !0
337
+ }
338
+ },
339
+ emits: ["next"],
340
+ setup(u, {
341
+ emit: o
342
+ }) {
343
+ const a = o, n = u, r = G(() => ce(n.email)), m = _(), t = _(!1), l = _(!1), y = _(), f = _({
344
+ userToken: void 0,
345
+ emailVerifyId: void 0
346
+ });
347
+ async function p() {
348
+ t.value = !0, X({
349
+ email: n.email
350
+ }).then(({
351
+ data: c
352
+ }) => {
353
+ f.value.emailVerifyId = c.emailVerifyId, t.value = !1, m.value.startCountFn();
354
+ }).catch(() => {
355
+ t.value = !1;
356
+ });
357
+ }
358
+ async function d() {
359
+ y.value.validate(["userToken"]).then((c) => {
360
+ if (!c) {
361
+ l.value = !0;
362
+ const v = {
363
+ email: n.email,
364
+ userToken: f.value.userToken,
365
+ emailVerifyId: f.value.emailVerifyId
366
+ };
367
+ Je(v).then(() => {
368
+ l.value = !1, a("next");
369
+ }).catch(() => {
370
+ l.value = !1;
371
+ });
372
+ }
373
+ });
374
+ }
375
+ return (c, v) => (g(), k(e(H), {
376
+ ref_key: "formRef",
377
+ ref: y,
378
+ model: f.value,
379
+ "auto-label-width": "",
380
+ size: n.size
381
+ }, {
382
+ default: s(() => [i(e(A), {
383
+ field: "email",
384
+ label: "邮箱",
385
+ rules: [{
386
+ required: !1,
387
+ message: "请输入邮箱"
388
+ }, {
389
+ type: "email",
390
+ message: "请输入有效的邮箱"
391
+ }]
392
+ }, {
393
+ default: s(() => [w(R(r.value), 1)]),
394
+ _: 1
395
+ }), i(e(A), {
396
+ field: "userToken",
397
+ label: "验证码",
398
+ "hide-label": "",
399
+ rules: [{
400
+ required: !0,
401
+ message: "请输入验证码"
402
+ }]
403
+ }, {
404
+ default: s(() => [z("div", Ye, [i(e(q), {
405
+ modelValue: f.value.userToken,
406
+ "onUpdate:modelValue": v[0] || (v[0] = (b) => f.value.userToken = b),
407
+ placeholder: "请输入验证码"
408
+ }, null, 8, ["modelValue"]), i(se, {
409
+ ref_key: "SendVerifyCodeRef",
410
+ ref: m,
411
+ size: n.size,
412
+ loading: t.value,
413
+ style: {
414
+ "margin-left": "10px"
415
+ },
416
+ onSend: p
417
+ }, null, 8, ["size", "loading"])])]),
418
+ _: 1
419
+ }), i(e(A), {
420
+ field: "",
421
+ label: "",
422
+ rules: []
423
+ }, {
424
+ default: s(() => [z("div", et, [i(e(V), {
425
+ loading: l.value,
426
+ type: "primary",
427
+ onClick: d
428
+ }, {
429
+ default: s(() => [...v[1] || (v[1] = [w(" 提交 ", -1)])]),
430
+ _: 1
431
+ }, 8, ["loading"])])]),
432
+ _: 1
433
+ })]),
434
+ _: 1
435
+ }, 8, ["model", "size"]));
436
+ }
437
+ }), ne = /* @__PURE__ */ $(tt, [["__scopeId", "data-v-89ebb370"]]), it = {
438
+ class: "handle"
439
+ }, lt = /* @__PURE__ */ I({
440
+ __name: "AuthkitPasswordUpdate",
441
+ props: {
442
+ size: {
443
+ type: String,
444
+ required: !0
445
+ }
446
+ },
447
+ emits: ["submit"],
448
+ setup(u, {
449
+ emit: o
450
+ }) {
451
+ const a = o, n = _(!1), r = _(), m = u, t = _({
452
+ oldPassword: "",
453
+ password: "",
454
+ confirmPassword: ""
455
+ });
456
+ async function l() {
457
+ r.value.validate().then((y) => {
458
+ if (!y) {
459
+ const f = {
460
+ password: t.value.password
461
+ };
462
+ xe(f).then(() => {
463
+ n.value = !1, a("submit", f);
464
+ }).catch(() => {
465
+ n.value = !1;
466
+ });
467
+ }
468
+ });
469
+ }
470
+ return (y, f) => (g(), k(e(H), {
471
+ ref_key: "formRef",
472
+ ref: r,
473
+ model: t.value,
474
+ "auto-label-width": "",
475
+ size: m.size
476
+ }, {
477
+ default: s(() => [i(e(A), {
478
+ field: "oldPassword",
479
+ label: "当前密码",
480
+ "hide-label": "",
481
+ rules: [{
482
+ required: !0,
483
+ message: "请输入当前密码"
484
+ }]
485
+ }, {
486
+ default: s(() => [i(e(q), {
487
+ modelValue: t.value.oldPassword,
488
+ "onUpdate:modelValue": f[0] || (f[0] = (p) => t.value.oldPassword = p),
489
+ placeholder: "请输入当前密码",
490
+ type: "password"
491
+ }, null, 8, ["modelValue"])]),
492
+ _: 1
493
+ }), i(e(A), {
494
+ field: "password",
495
+ label: "新密码",
496
+ "hide-label": "",
497
+ rules: [{
498
+ required: !0,
499
+ message: "新密码请输入"
500
+ }, {
501
+ minLength: 10,
502
+ message: "新密码不能少于10字符"
503
+ }]
504
+ }, {
505
+ default: s(() => [i(e(q), {
506
+ modelValue: t.value.password,
507
+ "onUpdate:modelValue": f[1] || (f[1] = (p) => t.value.password = p),
508
+ placeholder: "请输入新密码",
509
+ type: "password"
510
+ }, null, 8, ["modelValue"])]),
511
+ _: 1
512
+ }), i(e(A), {
513
+ field: "confirmPassword",
514
+ label: "确认密码",
515
+ "hide-label": "",
516
+ rules: [{
517
+ required: !0,
518
+ message: "请输入确认密码"
519
+ }, {
520
+ minLength: 10,
521
+ message: "确认密码不能少于10字符"
522
+ }, {
523
+ validator: (p, d) => {
524
+ p !== t.value.password ? d("两次密码输入不一致,请重新输入") : d();
525
+ }
526
+ }]
527
+ }, {
528
+ default: s(() => [i(e(q), {
529
+ modelValue: t.value.confirmPassword,
530
+ "onUpdate:modelValue": f[2] || (f[2] = (p) => t.value.confirmPassword = p),
531
+ placeholder: "请输入确认密码密码",
532
+ type: "password"
533
+ }, null, 8, ["modelValue"])]),
534
+ _: 1
535
+ }, 8, ["rules"]), i(e(A), {
536
+ field: "",
537
+ label: "",
538
+ rules: []
539
+ }, {
540
+ default: s(() => [z("div", it, [i(e(V), {
541
+ type: "primary",
542
+ loading: n.value,
543
+ onClick: l
544
+ }, {
545
+ default: s(() => [...f[3] || (f[3] = [w(" 提交 ", -1)])]),
546
+ _: 1
547
+ }, 8, ["loading"])])]),
548
+ _: 1
549
+ })]),
550
+ _: 1
551
+ }, 8, ["model", "size"]));
552
+ }
553
+ }), st = /* @__PURE__ */ $(lt, [["__scopeId", "data-v-a9e25b03"]]), nt = /* @__PURE__ */ I({
554
+ __name: "AuthkitSetPassword",
555
+ props: {
556
+ size: {
557
+ type: String,
558
+ required: !0
559
+ }
560
+ },
561
+ setup(u) {
562
+ const {
563
+ userProfile: o,
564
+ loading: a,
565
+ fetchUserProfile: n,
566
+ isLoggedIn: r
567
+ } = J(), m = _("hidden"), t = u;
568
+ function l(p) {
569
+ m.value = p;
570
+ }
571
+ function y(p) {
572
+ D.success("密码修改成功"), m.value = "hidden", n();
573
+ }
574
+ function f() {
575
+ m.value = "update";
576
+ }
577
+ return K(() => {
578
+ r.value && !o.value && n();
579
+ }), (p, d) => {
580
+ var c, v, b, U;
581
+ return g(), P(F, null, [!((c = e(o)) != null && c.email) && !((v = e(o)) != null && v.phone) ? (g(), k(e(E), {
582
+ key: 0,
583
+ title: "去绑定邮箱"
584
+ }, {
585
+ action: s(() => [i(e(V), {
586
+ size: t.size,
587
+ type: "primary",
588
+ onClick: d[0] || (d[0] = (C) => l("update"))
589
+ }, {
590
+ default: s(() => [...d[2] || (d[2] = [w(" 去绑定邮箱 ", -1)])]),
591
+ _: 1
592
+ }, 8, ["size"])]),
593
+ default: s(() => [d[3] || (d[3] = w(" 请先去绑定邮箱或者手机号码,才能设置密码 ", -1))]),
594
+ _: 1
595
+ })) : S("", !0), (b = e(o)) != null && b.email && m.value === "hidden" ? (g(), k(e(E), {
596
+ key: 1,
597
+ title: "更改密码"
598
+ }, {
599
+ action: s(() => [i(e(V), {
600
+ size: t.size,
601
+ type: "primary",
602
+ onClick: d[1] || (d[1] = (C) => l("verify"))
603
+ }, {
604
+ default: s(() => [...d[4] || (d[4] = [w("更改密码", -1)])]),
605
+ _: 1
606
+ }, 8, ["size"])]),
607
+ default: s(() => [d[5] || (d[5] = w(" 为了账户安全修改密码前会先验证身份 ", -1))]),
608
+ _: 1
609
+ })) : S("", !0), m.value === "update" ? (g(), k(st, {
610
+ key: 2,
611
+ size: t.size,
612
+ loading: e(a),
613
+ onSubmit: y
614
+ }, null, 8, ["size", "loading"])) : S("", !0), m.value === "verify" ? (g(), k(ne, {
615
+ key: 3,
616
+ size: t.size,
617
+ email: (U = e(o)) == null ? void 0 : U.email,
618
+ onNext: f
619
+ }, null, 8, ["size", "email"])) : S("", !0)], 64);
620
+ };
621
+ }
622
+ }), at = {
623
+ class: "content"
624
+ }, ot = {
625
+ class: "sendVerifyCodeItem"
626
+ }, rt = {
627
+ class: "handle"
628
+ }, ut = /* @__PURE__ */ I({
629
+ __name: "AuthkitEmailUpdate",
630
+ props: {
631
+ size: {
632
+ type: String,
633
+ required: !0
634
+ },
635
+ loading: {
636
+ type: Boolean,
637
+ required: !0,
638
+ default: () => !0
639
+ }
640
+ },
641
+ emits: ["submit"],
642
+ setup(u, {
643
+ emit: o
644
+ }) {
645
+ const a = o, n = u, r = _(), m = _(!1), t = _(), l = _({
646
+ email: void 0,
647
+ userToken: void 0,
648
+ emailVerifyId: void 0,
649
+ password: void 0,
650
+ confirmPassword: void 0,
651
+ referrerId: void 0
652
+ });
653
+ async function y() {
654
+ t.value.validateField(["email"]).then((p) => {
655
+ p || (m.value = !0, X({
656
+ email: l.value.email
657
+ }).then(({
658
+ data: d
659
+ }) => {
660
+ l.value.emailVerifyId = d.emailVerifyId, m.value = !1, r.value.startCountFn();
661
+ }).catch(() => {
662
+ m.value = !1;
663
+ }));
664
+ });
665
+ }
666
+ async function f() {
667
+ t.value.validate().then((p) => {
668
+ p || a("submit", l.value);
669
+ });
670
+ }
671
+ return (p, d) => (g(), P("div", at, [i(e(H), {
672
+ ref_key: "formRef",
673
+ ref: t,
674
+ model: l.value,
675
+ size: n.size,
676
+ "auto-label-width": ""
677
+ }, {
678
+ default: s(() => [i(e(A), {
679
+ field: "email",
680
+ label: "邮箱",
681
+ "hide-label": "",
682
+ rules: [{
683
+ required: !0,
684
+ message: "请输入邮箱"
685
+ }, {
686
+ type: "email",
687
+ message: "请输入有效的邮箱"
688
+ }]
689
+ }, {
690
+ default: s(() => [i(e(q), {
691
+ modelValue: l.value.email,
692
+ "onUpdate:modelValue": d[0] || (d[0] = (c) => l.value.email = c),
693
+ placeholder: "请输入邮箱",
694
+ autocomplete: "email username",
695
+ type: "email"
696
+ }, null, 8, ["modelValue"])]),
697
+ _: 1
698
+ }), i(e(A), {
699
+ field: "userToken",
700
+ label: "验证码",
701
+ "hide-label": "",
702
+ rules: [{
703
+ required: !0,
704
+ message: "请输入验证码"
705
+ }]
706
+ }, {
707
+ default: s(() => [z("div", ot, [i(e(q), {
708
+ modelValue: l.value.userToken,
709
+ "onUpdate:modelValue": d[1] || (d[1] = (c) => l.value.userToken = c),
710
+ placeholder: "请输入验证码",
711
+ autocomplete: "one-time-code"
712
+ }, null, 8, ["modelValue"]), i(se, {
713
+ ref_key: "SendVerifyCodeRef",
714
+ ref: r,
715
+ size: n.size,
716
+ loading: m.value,
717
+ style: {
718
+ "margin-left": "10px"
719
+ },
720
+ onSend: y
721
+ }, null, 8, ["size", "loading"])])]),
722
+ _: 1
723
+ }), i(e(A), {
724
+ field: "password",
725
+ label: "密码",
726
+ "hide-label": "",
727
+ rules: [{
728
+ required: !0,
729
+ message: "密码请输入"
730
+ }, {
731
+ minLength: 10,
732
+ message: "密码不能少于10字符"
733
+ }]
734
+ }, {
735
+ default: s(() => [i(e(q), {
736
+ modelValue: l.value.password,
737
+ "onUpdate:modelValue": d[2] || (d[2] = (c) => l.value.password = c),
738
+ placeholder: "请输入密码",
739
+ type: "password",
740
+ autocomplete: "new-password"
741
+ }, null, 8, ["modelValue"])]),
742
+ _: 1
743
+ }), i(e(A), {
744
+ field: "confirmPassword",
745
+ label: "确认密码",
746
+ "hide-label": "",
747
+ rules: [{
748
+ required: !0,
749
+ message: "请输入确认密码"
750
+ }, {
751
+ minLength: 10,
752
+ message: "确认密码不能少于10字符"
753
+ }, {
754
+ validator: (c, v) => {
755
+ c !== l.value.password ? v("两次密码输入不一致,请重新输入") : v();
756
+ }
757
+ }]
758
+ }, {
759
+ default: s(() => [i(e(q), {
760
+ modelValue: l.value.confirmPassword,
761
+ "onUpdate:modelValue": d[3] || (d[3] = (c) => l.value.confirmPassword = c),
762
+ placeholder: "请输入确认密码密码",
763
+ type: "password",
764
+ autocomplete: "new-password"
765
+ }, null, 8, ["modelValue"])]),
766
+ _: 1
767
+ }, 8, ["rules"]), i(e(A), {
768
+ field: "referrerId",
769
+ label: "邀请人",
770
+ "hide-label": "",
771
+ rules: [{
772
+ required: !1,
773
+ message: "请输入邀请人ID"
774
+ }]
775
+ }, {
776
+ default: s(() => [i(e(q), {
777
+ modelValue: l.value.referrerId,
778
+ "onUpdate:modelValue": d[4] || (d[4] = (c) => l.value.referrerId = c),
779
+ placeholder: "邀请人ID(可选)",
780
+ autocomplete: "off"
781
+ }, null, 8, ["modelValue"])]),
782
+ _: 1
783
+ }), z("div", rt, [i(e(V), {
784
+ type: "primary",
785
+ loading: n.loading,
786
+ long: "",
787
+ size: n.size,
788
+ onClick: f
789
+ }, {
790
+ default: s(() => [...d[5] || (d[5] = [w(" 提交 ", -1)])]),
791
+ _: 1
792
+ }, 8, ["loading", "size"])])]),
793
+ _: 1
794
+ }, 8, ["model", "size"])]));
795
+ }
796
+ }), fe = /* @__PURE__ */ $(ut, [["__scopeId", "data-v-5b701953"]]), dt = /* @__PURE__ */ I({
797
+ __name: "AuthkitEmailBinding",
798
+ props: {
799
+ size: {
800
+ type: String,
801
+ required: !0
802
+ }
803
+ },
804
+ setup(u) {
805
+ const {
806
+ userProfile: o,
807
+ loading: a,
808
+ fetchUserProfile: n
809
+ } = J(), r = _("hidden"), m = u;
810
+ function t(f) {
811
+ r.value = f;
812
+ }
813
+ function l(f) {
814
+ a.value = !0;
815
+ const p = {
816
+ email: f.email,
817
+ userToken: f.userToken,
818
+ emailVerifyId: f.emailVerifyId
819
+ };
820
+ qe(p).then(() => {
821
+ a.value = !1, D.success("绑定成功"), r.value = "hidden", n();
822
+ }).catch(() => {
823
+ a.value = !1;
824
+ });
825
+ }
826
+ function y() {
827
+ r.value = "update";
828
+ }
829
+ return K(() => {
830
+ o.value || n();
831
+ }), (f, p) => {
832
+ var d, c, v;
833
+ return g(), P(F, null, [!((d = e(o)) != null && d.email) && r.value === "hidden" ? (g(), k(e(E), {
834
+ key: 0,
835
+ title: "绑定邮箱"
836
+ }, {
837
+ action: s(() => [i(e(V), {
838
+ size: m.size,
839
+ type: "primary",
840
+ onClick: p[0] || (p[0] = (b) => t("update"))
841
+ }, {
842
+ default: s(() => [...p[2] || (p[2] = [w(" 绑定邮箱 ", -1)])]),
843
+ _: 1
844
+ }, 8, ["size"])]),
845
+ default: s(() => [p[3] || (p[3] = w(" 您还未绑定邮箱,请点击绑定邮箱 ", -1))]),
846
+ _: 1
847
+ })) : S("", !0), (c = e(o)) != null && c.email && r.value === "hidden" ? (g(), k(e(E), {
848
+ key: 1,
849
+ title: "更改邮箱"
850
+ }, {
851
+ action: s(() => [i(e(V), {
852
+ size: m.size,
853
+ type: "primary",
854
+ onClick: p[1] || (p[1] = (b) => t("verify"))
855
+ }, {
856
+ default: s(() => [...p[4] || (p[4] = [w(" 更改邮箱 ", -1)])]),
857
+ _: 1
858
+ }, 8, ["size"])]),
859
+ default: s(() => {
860
+ var b;
861
+ return [w(R(`您绑定的邮箱为${e(ce)((b = e(o)) == null ? void 0 : b.email)}`) + " ", 1)];
862
+ }),
863
+ _: 1
864
+ })) : S("", !0), r.value === "update" ? (g(), k(fe, {
865
+ key: 2,
866
+ loading: e(a),
867
+ size: m.size,
868
+ onSubmit: l
869
+ }, null, 8, ["loading", "size"])) : S("", !0), r.value === "verify" ? (g(), k(ne, {
870
+ key: 3,
871
+ size: m.size,
872
+ email: (v = e(o)) == null ? void 0 : v.email,
873
+ onNext: y
874
+ }, null, 8, ["size", "email"])) : S("", !0)], 64);
875
+ };
876
+ }
877
+ }), mt = /* @__PURE__ */ $(dt, [["__scopeId", "data-v-b2663ea1"]]);
878
+ function pe(u) {
879
+ return Z({
880
+ url: `${N.authPrefixUrl}/restfulApi/OAuth/github/login`,
881
+ method: "get",
882
+ params: u
883
+ });
884
+ }
885
+ const ct = /* @__PURE__ */ I({
886
+ __name: "AuthkitGithubBinding",
887
+ props: {
888
+ size: {
889
+ type: String,
890
+ required: !0
891
+ }
892
+ },
893
+ setup(u) {
894
+ const {
895
+ userProfile: o,
896
+ fetchUserProfile: a
897
+ } = J(), n = _("hidden"), r = _(!1);
898
+ let m;
899
+ const t = u;
900
+ function l(c) {
901
+ n.value = c;
902
+ }
903
+ function y() {
904
+ const c = N.appId;
905
+ if (!c) {
906
+ console.error("GitHub OAuth 失败: appId 未配置");
907
+ return;
908
+ }
909
+ pe({
910
+ appId: c
911
+ }).then(({
912
+ data: v
913
+ }) => {
914
+ const {
915
+ redirectUri: b
916
+ } = v;
917
+ r.value = !0, window.open(b, "_blank");
918
+ });
919
+ }
920
+ function f() {
921
+ Te().then(() => {
922
+ D.success("解绑成功"), n.value = "hidden", a();
923
+ });
924
+ }
925
+ function p() {
926
+ n.value === "bind" && (n.value = "hidden", y()), n.value === "unbind" && f();
927
+ }
928
+ function d() {
929
+ r.value && a();
930
+ }
931
+ return K(() => {
932
+ o.value || a(), m = setInterval(d, 1e3);
933
+ }), oe(() => {
934
+ m && clearInterval(m);
935
+ }), (c, v) => {
936
+ var b, U, C;
937
+ return g(), P(F, null, [!((b = e(o)) != null && b.github) && n.value === "hidden" ? (g(), k(e(E), {
938
+ key: 0,
939
+ title: "绑定GitHUb"
940
+ }, {
941
+ action: s(() => [i(e(V), {
942
+ size: t.size,
943
+ type: "primary",
944
+ onClick: v[0] || (v[0] = (T) => l("bind"))
945
+ }, {
946
+ default: s(() => [...v[2] || (v[2] = [w(" 绑定GitHUb ", -1)])]),
947
+ _: 1
948
+ }, 8, ["size"])]),
949
+ default: s(() => [v[3] || (v[3] = w(" 请尚未绑定GitHub,请点击绑定GitHUb ", -1))]),
950
+ _: 1
951
+ })) : S("", !0), (U = e(o)) != null && U.github && n.value === "hidden" ? (g(), k(e(E), {
952
+ key: 1,
953
+ title: "解绑GitHub"
954
+ }, {
955
+ action: s(() => [i(e(V), {
956
+ size: t.size,
957
+ type: "primary",
958
+ onClick: v[1] || (v[1] = (T) => l("unbind"))
959
+ }, {
960
+ default: s(() => [...v[4] || (v[4] = [w(" 解绑GitHUb ", -1)])]),
961
+ _: 1
962
+ }, 8, ["size"])]),
963
+ default: s(() => {
964
+ var T, B, O;
965
+ return [z("span", null, R(`您绑定的账号为 ${(B = (T = e(o)) == null ? void 0 : T.github) == null ? void 0 : B.login}`), 1), i(e(de), {
966
+ "image-url": (O = e(o)) == null ? void 0 : O.avatar,
967
+ size: 42
968
+ }, null, 8, ["image-url"])];
969
+ }),
970
+ _: 1
971
+ })) : S("", !0), n.value === "bind" || n.value === "unbind" ? (g(), k(ne, {
972
+ key: 2,
973
+ size: t.size,
974
+ email: (C = e(o)) == null ? void 0 : C.email,
975
+ onNext: p
976
+ }, null, 8, ["size", "email"])) : S("", !0)], 64);
977
+ };
978
+ }
979
+ }), ft = {
980
+ class: "dependency-list"
981
+ }, pt = {
982
+ class: "label"
983
+ }, vt = {
984
+ class: "count"
985
+ }, gt = {
986
+ class: "action-bar"
987
+ }, yt = /* @__PURE__ */ I({
988
+ __name: "AuthkitAccountDelete",
989
+ props: {
990
+ size: {
991
+ type: String,
992
+ required: !0
993
+ }
994
+ },
995
+ emits: ["deleted"],
996
+ setup(u, {
997
+ emit: o
998
+ }) {
999
+ const a = u, n = o, {
1000
+ userProfile: r,
1001
+ clearUserProfile: m
1002
+ } = J(), {
1003
+ clearAuth: t
1004
+ } = Q(), l = _("check"), y = _(!1), f = _([]), p = _(!1), d = _(""), c = _(0);
1005
+ let v = null;
1006
+ const b = G(() => {
1007
+ var W;
1008
+ const L = ((W = r.value) == null ? void 0 : W.email) || "";
1009
+ if (!L) return "";
1010
+ const [h, x] = L.split("@");
1011
+ return h.length <= 2 ? L : `${h.slice(0, 2)}***@${x}`;
1012
+ }), U = _(), C = _({
1013
+ userToken: "",
1014
+ password: "",
1015
+ confirmText: ""
1016
+ }), T = _(!1);
1017
+ function B(L, h) {
1018
+ L !== "注销" ? h('请输入"注销"以确认操作') : h();
1019
+ }
1020
+ async function O() {
1021
+ var L;
1022
+ y.value = !0;
1023
+ try {
1024
+ const h = await Re(), {
1025
+ hasDependencies: x,
1026
+ dependencies: W
1027
+ } = h.data;
1028
+ if (x)
1029
+ f.value = W, l.value = "dependencies";
1030
+ else {
1031
+ if (!((L = r.value) != null && L.email)) {
1032
+ D.error("账号未绑定邮箱,无法进行注销验证。请先绑定邮箱");
1033
+ return;
1034
+ }
1035
+ l.value = "sendCode";
1036
+ }
1037
+ } catch (h) {
1038
+ console.error("检查依赖失败:", h), D.error("检查失败,请稍后重试");
1039
+ } finally {
1040
+ y.value = !1;
1041
+ }
1042
+ }
1043
+ async function j() {
1044
+ var L;
1045
+ if (!((L = r.value) != null && L.email)) {
1046
+ D.error("请先绑定邮箱");
1047
+ return;
1048
+ }
1049
+ p.value = !0;
1050
+ try {
1051
+ const h = await X({
1052
+ email: r.value.email
1053
+ });
1054
+ d.value = h.data.emailVerifyId, D.success("验证码已发送"), l.value = "confirm", ye();
1055
+ } catch (h) {
1056
+ console.error("发送验证码失败:", h);
1057
+ } finally {
1058
+ p.value = !1;
1059
+ }
1060
+ }
1061
+ function ye() {
1062
+ c.value = 60, v && clearInterval(v), v = setInterval(() => {
1063
+ c.value--, c.value <= 0 && v && (clearInterval(v), v = null);
1064
+ }, 1e3);
1065
+ }
1066
+ async function he() {
1067
+ var h;
1068
+ if (!await ((h = U.value) == null ? void 0 : h.validate())) {
1069
+ T.value = !0;
1070
+ try {
1071
+ await Le({
1072
+ password: C.value.password,
1073
+ userToken: C.value.userToken,
1074
+ emailVerifyId: d.value,
1075
+ confirmText: C.value.confirmText
1076
+ }), l.value = "success", m(), t(), n("deleted");
1077
+ } catch (x) {
1078
+ console.error("注销失败:", x);
1079
+ } finally {
1080
+ T.value = !1;
1081
+ }
1082
+ }
1083
+ }
1084
+ function _e() {
1085
+ window.location.href = "/";
1086
+ }
1087
+ return (L, h) => l.value === "check" ? (g(), k(e(E), {
1088
+ key: 0,
1089
+ type: "warning",
1090
+ title: "注销账号"
1091
+ }, {
1092
+ action: s(() => [i(e(V), {
1093
+ size: a.size,
1094
+ type: "primary",
1095
+ status: "danger",
1096
+ loading: y.value,
1097
+ onClick: O
1098
+ }, {
1099
+ default: s(() => [w(R(y.value ? "检查中..." : "开始注销"), 1)]),
1100
+ _: 1
1101
+ }, 8, ["size", "loading"])]),
1102
+ default: s(() => [h[6] || (h[6] = w(" 注销账号后,您的所有数据将被永久删除,无法恢复。请确认您已备份重要数据。 ", -1))]),
1103
+ _: 1
1104
+ })) : l.value === "dependencies" ? (g(), P(F, {
1105
+ key: 1
1106
+ }, [i(e(E), {
1107
+ type: "error",
1108
+ title: "无法注销账号"
1109
+ }, {
1110
+ default: s(() => [...h[7] || (h[7] = [w(" 您的账号下还有以下资源,请先处理后再注销: ", -1)])]),
1111
+ _: 1
1112
+ }), z("div", ft, [(g(!0), P(F, null, ze(f.value, (x) => (g(), P("div", {
1113
+ key: x.type,
1114
+ class: "dependency-item"
1115
+ }, [z("span", pt, R(x.label), 1), z("span", vt, R(x.count) + " 个", 1)]))), 128))]), z("div", gt, [i(e(V), {
1116
+ size: a.size,
1117
+ onClick: h[0] || (h[0] = (x) => l.value = "check")
1118
+ }, {
1119
+ default: s(() => [...h[8] || (h[8] = [w("返回", -1)])]),
1120
+ _: 1
1121
+ }, 8, ["size"])])], 64)) : l.value === "sendCode" ? (g(), k(e(E), {
1122
+ key: 2,
1123
+ type: "normal",
1124
+ title: "身份验证"
1125
+ }, {
1126
+ action: s(() => [i(e(Y), null, {
1127
+ default: s(() => [i(e(V), {
1128
+ size: a.size,
1129
+ onClick: h[1] || (h[1] = (x) => l.value = "check")
1130
+ }, {
1131
+ default: s(() => [...h[9] || (h[9] = [w("取消", -1)])]),
1132
+ _: 1
1133
+ }, 8, ["size"]), i(e(V), {
1134
+ size: a.size,
1135
+ type: "primary",
1136
+ loading: p.value,
1137
+ onClick: j
1138
+ }, {
1139
+ default: s(() => [w(R(p.value ? "发送中..." : "发送验证码"), 1)]),
1140
+ _: 1
1141
+ }, 8, ["size", "loading"])]),
1142
+ _: 1
1143
+ })]),
1144
+ default: s(() => [w(" 为确保账号安全,我们将向您的邮箱 " + R(b.value) + " 发送验证码 ", 1)]),
1145
+ _: 1
1146
+ })) : l.value === "confirm" ? (g(), P(F, {
1147
+ key: 3
1148
+ }, [i(e(E), {
1149
+ type: "warning",
1150
+ title: "确认注销"
1151
+ }, {
1152
+ default: s(() => [w(" 验证码已发送至 " + R(b.value) + ",此操作不可逆,请谨慎操作 ", 1)]),
1153
+ _: 1
1154
+ }), i(e(H), {
1155
+ ref_key: "formRef",
1156
+ ref: U,
1157
+ model: C.value,
1158
+ size: a.size,
1159
+ class: "confirm-form",
1160
+ layout: "vertical"
1161
+ }, {
1162
+ default: s(() => [i(e(A), {
1163
+ field: "userToken",
1164
+ label: "邮箱验证码",
1165
+ rules: [{
1166
+ required: !0,
1167
+ message: "请输入验证码"
1168
+ }]
1169
+ }, {
1170
+ default: s(() => [i(e(Y), null, {
1171
+ default: s(() => [i(e(q), {
1172
+ modelValue: C.value.userToken,
1173
+ "onUpdate:modelValue": h[2] || (h[2] = (x) => C.value.userToken = x),
1174
+ placeholder: "请输入6位验证码",
1175
+ "max-length": 6,
1176
+ "allow-clear": "",
1177
+ style: {
1178
+ width: "180px"
1179
+ }
1180
+ }, null, 8, ["modelValue"]), i(e(V), {
1181
+ disabled: c.value > 0,
1182
+ loading: p.value,
1183
+ onClick: j
1184
+ }, {
1185
+ default: s(() => [w(R(c.value > 0 ? `${c.value}s 后重发` : "重新发送"), 1)]),
1186
+ _: 1
1187
+ }, 8, ["disabled", "loading"])]),
1188
+ _: 1
1189
+ })]),
1190
+ _: 1
1191
+ }), i(e(A), {
1192
+ field: "password",
1193
+ label: "登录密码",
1194
+ rules: [{
1195
+ required: !0,
1196
+ message: "请输入密码"
1197
+ }]
1198
+ }, {
1199
+ default: s(() => [i(e(Ie), {
1200
+ modelValue: C.value.password,
1201
+ "onUpdate:modelValue": h[3] || (h[3] = (x) => C.value.password = x),
1202
+ placeholder: "请输入您的登录密码",
1203
+ "allow-clear": ""
1204
+ }, null, 8, ["modelValue"])]),
1205
+ _: 1
1206
+ }), i(e(A), {
1207
+ field: "confirmText",
1208
+ label: "请输入「注销」以确认",
1209
+ rules: [{
1210
+ required: !0,
1211
+ message: "请输入确认文字"
1212
+ }, {
1213
+ validator: B
1214
+ }]
1215
+ }, {
1216
+ default: s(() => [i(e(q), {
1217
+ modelValue: C.value.confirmText,
1218
+ "onUpdate:modelValue": h[4] || (h[4] = (x) => C.value.confirmText = x),
1219
+ placeholder: "注销",
1220
+ "allow-clear": ""
1221
+ }, null, 8, ["modelValue"])]),
1222
+ _: 1
1223
+ }, 8, ["rules"]), i(e(A), null, {
1224
+ default: s(() => [i(e(Y), null, {
1225
+ default: s(() => [i(e(V), {
1226
+ onClick: h[5] || (h[5] = (x) => l.value = "check")
1227
+ }, {
1228
+ default: s(() => [...h[10] || (h[10] = [w("取消", -1)])]),
1229
+ _: 1
1230
+ }), i(e(V), {
1231
+ type: "primary",
1232
+ status: "danger",
1233
+ loading: T.value,
1234
+ onClick: he
1235
+ }, {
1236
+ default: s(() => [w(R(T.value ? "注销中..." : "确认注销"), 1)]),
1237
+ _: 1
1238
+ }, 8, ["loading"])]),
1239
+ _: 1
1240
+ })]),
1241
+ _: 1
1242
+ })]),
1243
+ _: 1
1244
+ }, 8, ["model", "size"])], 64)) : l.value === "success" ? (g(), k(e(Ve), {
1245
+ key: 4,
1246
+ status: "success",
1247
+ title: "账号已注销"
1248
+ }, {
1249
+ subtitle: s(() => [...h[11] || (h[11] = [w(" 您的账号已成功注销,感谢您的使用 ", -1)])]),
1250
+ extra: s(() => [i(e(V), {
1251
+ type: "primary",
1252
+ onClick: _e
1253
+ }, {
1254
+ default: s(() => [...h[12] || (h[12] = [w("返回首页", -1)])]),
1255
+ _: 1
1256
+ })]),
1257
+ _: 1
1258
+ })) : S("", !0);
1259
+ }
1260
+ }), ht = /* @__PURE__ */ $(yt, [["__scopeId", "data-v-15e302c7"]]), _t = {
1261
+ class: "content"
1262
+ }, wt = {
1263
+ class: "left"
1264
+ }, bt = {
1265
+ class: "right"
1266
+ }, kt = /* @__PURE__ */ I({
1267
+ __name: "AuthkitAppSetting",
1268
+ emits: ["confirm", "cancel"],
1269
+ setup(u, {
1270
+ expose: o,
1271
+ emit: a
1272
+ }) {
1273
+ const n = a;
1274
+ function r() {
1275
+ n("cancel");
1276
+ }
1277
+ function m() {
1278
+ d.value = !1, n("cancel");
1279
+ }
1280
+ const t = _("large"), l = _(["PersonalInformation"]), y = _([{
1281
+ name: "个人信息",
1282
+ path: "PersonalInformation",
1283
+ meta: {
1284
+ icon: "mingcute:user-edit-fill"
1285
+ },
1286
+ children: []
1287
+ }, {
1288
+ name: "账户管理",
1289
+ path: "AccountManage",
1290
+ meta: {
1291
+ icon: "mingcute:badge-fill"
1292
+ },
1293
+ children: [{
1294
+ name: "邮箱",
1295
+ path: "EmailBinding",
1296
+ meta: {
1297
+ icon: "ic:baseline-email"
1298
+ }
1299
+ }, {
1300
+ name: "密码",
1301
+ path: "SetPassword",
1302
+ meta: {
1303
+ icon: "mdi:password"
1304
+ }
1305
+ }, {
1306
+ name: "注销账号",
1307
+ path: "AccountDelete",
1308
+ meta: {
1309
+ icon: "mdi:account-remove"
1310
+ }
1311
+ }]
1312
+ }, {
1313
+ name: "第三方账户",
1314
+ path: "AccountBinding",
1315
+ meta: {
1316
+ icon: "mingcute:link-fill"
1317
+ },
1318
+ children: [
1319
+ {
1320
+ name: "GitHub",
1321
+ path: "GithubBinding",
1322
+ meta: {
1323
+ icon: "bi:github"
1324
+ }
1325
+ }
1326
+ // {
1327
+ // name: '微信',
1328
+ // icon: 'Menus/Space/Message/NoticeNotifications',
1329
+ // path: 'NoticeNotifications',
1330
+ // },
1331
+ ]
1332
+ }]);
1333
+ function f(v, b) {
1334
+ const U = v.path;
1335
+ console.log(U, b, "lokokoko"), l.value = [U];
1336
+ }
1337
+ const {
1338
+ changeType: p,
1339
+ show: d
1340
+ } = Ge(n);
1341
+ function c(v, b) {
1342
+ console.log(v), d.value = b, p.value = "编辑";
1343
+ }
1344
+ return o({
1345
+ setData: c
1346
+ }), (v, b) => (g(), k(e(me), {
1347
+ visible: e(d),
1348
+ "onUpdate:visible": b[1] || (b[1] = (U) => re(d) ? d.value = U : null),
1349
+ "unmount-on-close": "",
1350
+ "body-class": "AppSettingbodyClass",
1351
+ "mask-closable": !1,
1352
+ footer: !1,
1353
+ width: "700px",
1354
+ onCancel: r
1355
+ }, {
1356
+ title: s(() => [...b[2] || (b[2] = [w(" 系统设置 ", -1)])]),
1357
+ default: s(() => [z("div", _t, [z("div", wt, [i(De, {
1358
+ "selected-keys": l.value,
1359
+ "onUpdate:selectedKeys": b[0] || (b[0] = (U) => l.value = U),
1360
+ menus: y.value,
1361
+ onChange: f
1362
+ }, null, 8, ["selected-keys", "menus"])]), z("div", bt, [l.value[0] === "PersonalInformation" ? (g(), k(Ze, {
1363
+ key: 0,
1364
+ size: t.value
1365
+ }, null, 8, ["size"])) : S("", !0), l.value[0] === "EmailBinding" ? (g(), k(mt, {
1366
+ key: 1,
1367
+ size: t.value
1368
+ }, null, 8, ["size"])) : S("", !0), l.value[0] === "SetPassword" ? (g(), k(nt, {
1369
+ key: 2,
1370
+ size: t.value
1371
+ }, null, 8, ["size"])) : S("", !0), l.value[0] === "GithubBinding" ? (g(), k(ct, {
1372
+ key: 3,
1373
+ size: t.value
1374
+ }, null, 8, ["size"])) : S("", !0), l.value[0] === "AccountDelete" ? (g(), k(ht, {
1375
+ key: 4,
1376
+ size: t.value,
1377
+ onDeleted: m
1378
+ }, null, 8, ["size"])) : S("", !0)])])]),
1379
+ _: 1
1380
+ }, 8, ["visible"]));
1381
+ }
1382
+ }), Vi = /* @__PURE__ */ $(kt, [["__scopeId", "data-v-9f056370"]]);
1383
+ function zt(u) {
1384
+ const o = N.appId;
1385
+ if (!o) {
1386
+ console.error("GitHub OAuth 失败: appId 未配置");
1387
+ return;
1388
+ }
1389
+ pe({
1390
+ appId: o,
1391
+ referrerId: u
1392
+ }).then(({
1393
+ data: a
1394
+ }) => {
1395
+ const {
1396
+ redirectUri: n
1397
+ } = a;
1398
+ n ? window.location.href = n : console.error("GitHub OAuth 重定向URL为空");
1399
+ }).catch((a) => {
1400
+ console.error("GitHub OAuth 授权失败:", a);
1401
+ });
1402
+ }
1403
+ function St() {
1404
+ }
1405
+ function At() {
1406
+ }
1407
+ function It() {
1408
+ return {
1409
+ githubAuth: zt,
1410
+ googleAuth: St,
1411
+ microsoftAuth: At
1412
+ };
1413
+ }
1414
+ const te = /* @__PURE__ */ I({
1415
+ __name: "AuthkitOAuthItem",
1416
+ props: {
1417
+ size: {
1418
+ type: String,
1419
+ required: !0
1420
+ },
1421
+ icon: {
1422
+ type: String,
1423
+ required: !0,
1424
+ default: () => ""
1425
+ },
1426
+ label: {
1427
+ type: String,
1428
+ required: !0,
1429
+ default: () => ""
1430
+ }
1431
+ },
1432
+ emits: [],
1433
+ setup(u, {
1434
+ emit: o
1435
+ }) {
1436
+ const a = u;
1437
+ return (n, r) => (g(), k(e(V), {
1438
+ class: "OAuthItem",
1439
+ type: "primary",
1440
+ size: a.size
1441
+ }, {
1442
+ icon: s(() => [i(e(He), {
1443
+ icon: a.icon
1444
+ }, null, 8, ["icon"])]),
1445
+ default: s(() => [z("span", null, R(a.label), 1)]),
1446
+ _: 1
1447
+ }, 8, ["size"]));
1448
+ }
1449
+ }), Vt = {
1450
+ class: "OAuthList"
1451
+ }, Pt = {
1452
+ class: "OAuthList"
1453
+ }, Ut = /* @__PURE__ */ I({
1454
+ __name: "AuthkitOAuthList",
1455
+ props: {
1456
+ size: {
1457
+ type: String,
1458
+ default: () => "large"
1459
+ },
1460
+ appId: {
1461
+ type: String,
1462
+ default: () => ""
1463
+ }
1464
+ },
1465
+ setup(u) {
1466
+ const {
1467
+ appsData: o
1468
+ } = le(), a = u, {
1469
+ githubAuth: n,
1470
+ googleAuth: r,
1471
+ microsoftAuth: m
1472
+ } = It(), t = G(() => !(!o.value.oauth.google.enabled && !o.value.oauth.microsoft.enabled && !o.value.oauth.github.enabled && !o.value.oauth.wechat.enabled));
1473
+ return (l, y) => (g(), P("div", Vt, [t.value ? (g(), k(e(Pe), {
1474
+ key: 0,
1475
+ orientation: "center"
1476
+ }, {
1477
+ default: s(() => [...y[0] || (y[0] = [w("OAuth登陆", -1)])]),
1478
+ _: 1
1479
+ })) : S("", !0), z("div", Pt, [e(o).oauth.github.enabled ? (g(), k(te, {
1480
+ key: 0,
1481
+ icon: "mdi:github",
1482
+ label: "Github",
1483
+ size: a.size,
1484
+ onClick: e(n)
1485
+ }, null, 8, ["size", "onClick"])) : S("", !0), e(o).oauth.google.enabled ? (g(), k(te, {
1486
+ key: 1,
1487
+ icon: "mdi:google",
1488
+ label: "Google",
1489
+ size: a.size,
1490
+ onClick: e(r)
1491
+ }, null, 8, ["size", "onClick"])) : S("", !0), e(o).oauth.microsoft.enabled ? (g(), k(te, {
1492
+ key: 2,
1493
+ icon: "mdi:microsoft",
1494
+ label: "Microsoft",
1495
+ size: a.size,
1496
+ onClick: e(m)
1497
+ }, null, 8, ["size", "onClick"])) : S("", !0)])]));
1498
+ }
1499
+ }), Ct = /* @__PURE__ */ $(Ut, [["__scopeId", "data-v-49ca3bca"]]), $t = {
1500
+ class: "content"
1501
+ }, xt = {
1502
+ class: "sendVerifyCodeItem"
1503
+ }, qt = {
1504
+ class: "handle"
1505
+ }, Tt = /* @__PURE__ */ I({
1506
+ __name: "AuthkitPasswordUpdateAndVerify",
1507
+ props: {
1508
+ size: {
1509
+ type: String,
1510
+ required: !0
1511
+ },
1512
+ loading: {
1513
+ type: Boolean,
1514
+ required: !0,
1515
+ default: () => !0
1516
+ }
1517
+ },
1518
+ emits: ["signIn", "submit"],
1519
+ setup(u, {
1520
+ emit: o
1521
+ }) {
1522
+ const a = o, n = u, r = _(), m = _(!1), t = _(), l = _({
1523
+ email: void 0,
1524
+ userToken: void 0,
1525
+ emailVerifyId: void 0,
1526
+ password: void 0,
1527
+ confirmPassword: void 0
1528
+ });
1529
+ async function y() {
1530
+ t.value.validateField(["email"]).then((p) => {
1531
+ p || (m.value = !0, X({
1532
+ email: l.value.email
1533
+ }).then(({
1534
+ data: d
1535
+ }) => {
1536
+ m.value = !1, l.value.emailVerifyId = d.emailVerifyId, r.value.startCountFn();
1537
+ }).catch(() => {
1538
+ m.value = !1;
1539
+ }));
1540
+ });
1541
+ }
1542
+ async function f() {
1543
+ t.value.validate().then((p) => {
1544
+ p || a("submit", l.value);
1545
+ });
1546
+ }
1547
+ return (p, d) => (g(), P("div", $t, [i(e(H), {
1548
+ ref_key: "formRef",
1549
+ ref: t,
1550
+ model: l.value,
1551
+ size: n.size,
1552
+ "auto-label-width": ""
1553
+ }, {
1554
+ default: s(() => [i(e(A), {
1555
+ field: "email",
1556
+ label: "邮箱",
1557
+ "hide-label": "",
1558
+ rules: [{
1559
+ required: !0,
1560
+ message: "请输入邮箱"
1561
+ }, {
1562
+ type: "email",
1563
+ message: "请输入有效的邮箱"
1564
+ }]
1565
+ }, {
1566
+ default: s(() => [i(e(q), {
1567
+ modelValue: l.value.email,
1568
+ "onUpdate:modelValue": d[0] || (d[0] = (c) => l.value.email = c),
1569
+ placeholder: "请输入邮箱"
1570
+ }, null, 8, ["modelValue"])]),
1571
+ _: 1
1572
+ }), i(e(A), {
1573
+ field: "userToken",
1574
+ label: "验证码",
1575
+ "hide-label": "",
1576
+ rules: [{
1577
+ required: !0,
1578
+ message: "请输入验证码"
1579
+ }]
1580
+ }, {
1581
+ default: s(() => [z("div", xt, [i(e(q), {
1582
+ modelValue: l.value.userToken,
1583
+ "onUpdate:modelValue": d[1] || (d[1] = (c) => l.value.userToken = c),
1584
+ placeholder: "请输入验证码"
1585
+ }, null, 8, ["modelValue"]), i(se, {
1586
+ ref_key: "SendVerifyCodeRef",
1587
+ ref: r,
1588
+ size: n.size,
1589
+ loading: m.value,
1590
+ style: {
1591
+ "margin-left": "10px"
1592
+ },
1593
+ onSend: y
1594
+ }, null, 8, ["size", "loading"])])]),
1595
+ _: 1
1596
+ }), i(e(A), {
1597
+ field: "password",
1598
+ label: "密码",
1599
+ "hide-label": "",
1600
+ rules: [{
1601
+ required: !0,
1602
+ message: "密码请输入"
1603
+ }, {
1604
+ minLength: 10,
1605
+ message: "密码不能少于10字符"
1606
+ }]
1607
+ }, {
1608
+ default: s(() => [i(e(q), {
1609
+ modelValue: l.value.password,
1610
+ "onUpdate:modelValue": d[2] || (d[2] = (c) => l.value.password = c),
1611
+ placeholder: "请输入密码",
1612
+ type: "password",
1613
+ autocomplete: ""
1614
+ }, null, 8, ["modelValue"])]),
1615
+ _: 1
1616
+ }), i(e(A), {
1617
+ field: "confirmPassword",
1618
+ label: "确认密码",
1619
+ "hide-label": "",
1620
+ rules: [{
1621
+ required: !0,
1622
+ message: "请输入确认密码"
1623
+ }, {
1624
+ minLength: 10,
1625
+ message: "确认密码不能少于10字符"
1626
+ }, {
1627
+ validator: (c, v) => {
1628
+ c !== l.value.password ? v("两次密码输入不一致,请重新输入") : v();
1629
+ }
1630
+ }]
1631
+ }, {
1632
+ default: s(() => [i(e(q), {
1633
+ modelValue: l.value.confirmPassword,
1634
+ "onUpdate:modelValue": d[3] || (d[3] = (c) => l.value.confirmPassword = c),
1635
+ placeholder: "请输入确认密码密码",
1636
+ type: "password",
1637
+ autocomplete: ""
1638
+ }, null, 8, ["modelValue"])]),
1639
+ _: 1
1640
+ }, 8, ["rules"]), z("div", qt, [i(e(V), {
1641
+ type: "primary",
1642
+ loading: n.loading,
1643
+ long: "",
1644
+ size: n.size,
1645
+ onClick: f
1646
+ }, {
1647
+ default: s(() => [...d[4] || (d[4] = [w(" 提交 ", -1)])]),
1648
+ _: 1
1649
+ }, 8, ["loading", "size"])])]),
1650
+ _: 1
1651
+ }, 8, ["model", "size"])]));
1652
+ }
1653
+ }), Rt = /* @__PURE__ */ $(Tt, [["__scopeId", "data-v-1c83f44a"]]), Lt = {
1654
+ class: "SwitchSignIn"
1655
+ }, Bt = /* @__PURE__ */ I({
1656
+ __name: "AuthkitSwitchSignIn",
1657
+ emits: ["switchSignIn"],
1658
+ setup(u, {
1659
+ emit: o
1660
+ }) {
1661
+ const a = o;
1662
+ function n() {
1663
+ a("switchSignIn");
1664
+ }
1665
+ return (r, m) => (g(), P("div", Lt, [z("span", null, [m[1] || (m[1] = z("span", null, "已经有账号?", -1)), i(e(M), {
1666
+ style: {
1667
+ padding: "0px"
1668
+ },
1669
+ onClick: n
1670
+ }, {
1671
+ default: s(() => [...m[0] || (m[0] = [w("去登陆", -1)])]),
1672
+ _: 1
1673
+ })])]));
1674
+ }
1675
+ }), ve = /* @__PURE__ */ $(Bt, [["__scopeId", "data-v-fc1d3903"]]), Ot = {
1676
+ class: "ResetPassword"
1677
+ }, Et = /* @__PURE__ */ I({
1678
+ __name: "AuthkitResetPassword",
1679
+ props: {
1680
+ size: {
1681
+ type: String,
1682
+ required: !0,
1683
+ default: () => "large"
1684
+ },
1685
+ loading: {
1686
+ type: Boolean,
1687
+ required: !0,
1688
+ default: () => !0
1689
+ }
1690
+ },
1691
+ emits: ["switchSignIn", "submit"],
1692
+ setup(u, {
1693
+ emit: o
1694
+ }) {
1695
+ const a = o, n = u;
1696
+ function r() {
1697
+ a("switchSignIn");
1698
+ }
1699
+ async function m(t) {
1700
+ a("submit", t);
1701
+ }
1702
+ return (t, l) => (g(), P("div", Ot, [i(Rt, {
1703
+ loading: u.loading,
1704
+ size: n.size,
1705
+ onSubmit: m
1706
+ }, null, 8, ["loading", "size"]), i(ve, {
1707
+ onSwitchSignIn: r
1708
+ })]));
1709
+ }
1710
+ }), Dt = /* @__PURE__ */ $(Et, [["__scopeId", "data-v-0622cbe3"]]), Gt = {
1711
+ class: "ServiceAgreementAndPrivacyProtection"
1712
+ }, Ht = /* @__PURE__ */ I({
1713
+ __name: "AuthkitServiceAgreementAndPrivacyProtection",
1714
+ emits: ["toUserServiceAgreement", "toPrivacyPolicy"],
1715
+ setup(u, {
1716
+ emit: o
1717
+ }) {
1718
+ const a = o;
1719
+ function n() {
1720
+ a("toUserServiceAgreement");
1721
+ }
1722
+ function r() {
1723
+ a("toPrivacyPolicy");
1724
+ }
1725
+ return (m, t) => (g(), P("div", Gt, [t[2] || (t[2] = z("span", null, " 注册登陆即表示同意", -1)), i(e(M), {
1726
+ onClick: n
1727
+ }, {
1728
+ default: s(() => [...t[0] || (t[0] = [w("用户服务协议", -1)])]),
1729
+ _: 1
1730
+ }), t[3] || (t[3] = z("span", null, " 和 ", -1)), i(e(M), {
1731
+ onClick: r
1732
+ }, {
1733
+ default: s(() => [...t[1] || (t[1] = [w("隐私协议", -1)])]),
1734
+ _: 1
1735
+ })]));
1736
+ }
1737
+ }), Nt = /* @__PURE__ */ $(Ht, [["__scopeId", "data-v-18e831ec"]]), Ft = {
1738
+ class: "content"
1739
+ }, Mt = {
1740
+ class: "handle"
1741
+ }, jt = /* @__PURE__ */ I({
1742
+ __name: "AuthkitPasswordAuth",
1743
+ props: {
1744
+ size: {
1745
+ type: String,
1746
+ required: !0
1747
+ },
1748
+ loading: {
1749
+ type: Boolean,
1750
+ required: !0,
1751
+ default: () => !0
1752
+ }
1753
+ },
1754
+ emits: ["submit"],
1755
+ setup(u, {
1756
+ emit: o
1757
+ }) {
1758
+ const a = o, n = u;
1759
+ async function r(y, f) {
1760
+ const p = await Qe({
1761
+ password: y
1762
+ });
1763
+ p || f("密码验证请求出错!");
1764
+ const {
1765
+ isValidate: d,
1766
+ message: c
1767
+ } = p.data;
1768
+ d || f(c), f();
1769
+ }
1770
+ const m = _(), t = _({
1771
+ email: void 0,
1772
+ password: void 0
1773
+ });
1774
+ async function l() {
1775
+ m.value.validate().then((y) => {
1776
+ y || a("submit", t.value);
1777
+ });
1778
+ }
1779
+ return (y, f) => (g(), P("div", Ft, [i(e(H), {
1780
+ ref_key: "formRef",
1781
+ ref: m,
1782
+ model: t.value,
1783
+ size: n.size,
1784
+ "auto-label-width": ""
1785
+ }, {
1786
+ default: s(() => [i(e(A), {
1787
+ field: "email",
1788
+ label: "邮箱",
1789
+ "hide-label": "",
1790
+ rules: [{
1791
+ required: !0,
1792
+ message: "请输入邮箱"
1793
+ }, {
1794
+ type: "email",
1795
+ message: "请输入有效的邮箱"
1796
+ }]
1797
+ }, {
1798
+ default: s(() => [i(e(q), {
1799
+ modelValue: t.value.email,
1800
+ "onUpdate:modelValue": f[0] || (f[0] = (p) => t.value.email = p),
1801
+ placeholder: "请输入邮箱",
1802
+ autocomplete: "email username",
1803
+ type: "email"
1804
+ }, null, 8, ["modelValue"])]),
1805
+ _: 1
1806
+ }), i(e(A), {
1807
+ field: "password",
1808
+ label: "密码",
1809
+ "hide-label": "",
1810
+ rules: [{
1811
+ required: !0,
1812
+ message: "请输入密码"
1813
+ }, {
1814
+ validator: r
1815
+ }]
1816
+ }, {
1817
+ default: s(() => [i(e(q), {
1818
+ modelValue: t.value.password,
1819
+ "onUpdate:modelValue": f[1] || (f[1] = (p) => t.value.password = p),
1820
+ placeholder: "请输入密码",
1821
+ type: "password",
1822
+ autocomplete: "current-password"
1823
+ }, null, 8, ["modelValue"])]),
1824
+ _: 1
1825
+ }, 8, ["rules"]), z("div", Mt, [i(e(V), {
1826
+ type: "primary",
1827
+ loading: n.loading,
1828
+ long: "",
1829
+ size: n.size,
1830
+ onClick: l
1831
+ }, {
1832
+ default: s(() => [...f[2] || (f[2] = [w(" 登陆 ", -1)])]),
1833
+ _: 1
1834
+ }, 8, ["loading", "size"])])]),
1835
+ _: 1
1836
+ }, 8, ["model", "size"])]));
1837
+ }
1838
+ }), Wt = /* @__PURE__ */ $(jt, [["__scopeId", "data-v-76d6bc26"]]), Kt = {
1839
+ class: "SwitchSignUpOrResetPassword"
1840
+ }, Zt = /* @__PURE__ */ I({
1841
+ __name: "AuthkitSwitchSignUpOrResetPassword",
1842
+ emits: ["switchSignUp", "switchResetPassword"],
1843
+ setup(u, {
1844
+ emit: o
1845
+ }) {
1846
+ const a = o;
1847
+ function n() {
1848
+ a("switchSignUp");
1849
+ }
1850
+ function r() {
1851
+ a("switchResetPassword");
1852
+ }
1853
+ return (m, t) => (g(), P("div", Kt, [z("span", null, [t[1] || (t[1] = z("span", null, " 还没有账户?", -1)), i(e(M), {
1854
+ style: {
1855
+ padding: "0px"
1856
+ },
1857
+ onClick: n
1858
+ }, {
1859
+ default: s(() => [...t[0] || (t[0] = [w("去注册?", -1)])]),
1860
+ _: 1
1861
+ })]), i(e(M), {
1862
+ style: {
1863
+ padding: "0px"
1864
+ },
1865
+ onClick: r
1866
+ }, {
1867
+ default: s(() => [...t[2] || (t[2] = [w(" 忘记密码?", -1)])]),
1868
+ _: 1
1869
+ })]));
1870
+ }
1871
+ }), Jt = /* @__PURE__ */ $(Zt, [["__scopeId", "data-v-14e3aab2"]]), Qt = {
1872
+ class: "SignIn"
1873
+ }, Xt = /* @__PURE__ */ I({
1874
+ __name: "AuthkitSignIn",
1875
+ props: {
1876
+ size: {
1877
+ type: String,
1878
+ required: !0
1879
+ },
1880
+ loading: {
1881
+ type: Boolean,
1882
+ required: !0,
1883
+ default: () => !0
1884
+ }
1885
+ },
1886
+ emits: ["submit", "switchSignUp", "switchResetPassword"],
1887
+ setup(u, {
1888
+ emit: o
1889
+ }) {
1890
+ const a = o, n = u, r = Se(), m = G(() => !!r.OAuth);
1891
+ function t() {
1892
+ a("switchSignUp");
1893
+ }
1894
+ function l() {
1895
+ a("switchResetPassword");
1896
+ }
1897
+ async function y(f) {
1898
+ a("submit", f);
1899
+ }
1900
+ return (f, p) => (g(), P("div", Qt, [S("", !0), i(Wt, {
1901
+ loading: n.loading,
1902
+ size: n.size,
1903
+ onSubmit: y
1904
+ }, null, 8, ["loading", "size"]), m.value ? ue(f.$slots, "OAuth", {
1905
+ key: 1
1906
+ }, void 0, !0) : S("", !0), i(Jt, {
1907
+ onSwitchSignUp: t,
1908
+ onSwitchResetPassword: l
1909
+ })]));
1910
+ }
1911
+ }), Yt = /* @__PURE__ */ $(Xt, [["__scopeId", "data-v-f52ce3b3"]]), ei = {
1912
+ class: "SignUp"
1913
+ }, ti = /* @__PURE__ */ I({
1914
+ __name: "AuthkitSignUp",
1915
+ props: {
1916
+ size: {
1917
+ type: String,
1918
+ required: !0
1919
+ },
1920
+ loading: {
1921
+ type: Boolean,
1922
+ required: !0,
1923
+ default: () => !0
1924
+ }
1925
+ },
1926
+ emits: ["switchSignIn", "submit"],
1927
+ setup(u, {
1928
+ emit: o
1929
+ }) {
1930
+ const a = o, n = u;
1931
+ function r() {
1932
+ a("switchSignIn");
1933
+ }
1934
+ async function m(t) {
1935
+ a("submit", t);
1936
+ }
1937
+ return (t, l) => (g(), P("div", ei, [i(fe, {
1938
+ size: n.size,
1939
+ loading: u.loading,
1940
+ onSubmit: m
1941
+ }, null, 8, ["size", "loading"]), i(ve, {
1942
+ onSwitchSignIn: r
1943
+ })]));
1944
+ }
1945
+ }), ii = /* @__PURE__ */ $(ti, [["__scopeId", "data-v-058bbbef"]]), li = ["src"], si = /* @__PURE__ */ I({
1946
+ __name: "AuthkitAuthTitle",
1947
+ props: {
1948
+ size: {
1949
+ type: [String, Number],
1950
+ required: !1,
1951
+ default: 30
1952
+ },
1953
+ fontSize: {
1954
+ type: Number,
1955
+ required: !1,
1956
+ default: 18
1957
+ },
1958
+ lineHeight: {
1959
+ type: Number,
1960
+ required: !1,
1961
+ default: 60
1962
+ }
1963
+ },
1964
+ setup(u) {
1965
+ const o = u, a = `${o.size}px`, n = `${o.fontSize}px`, r = `${o.lineHeight}px`, {
1966
+ currentView: m
1967
+ } = Q(), {
1968
+ appsData: t
1969
+ } = le(), l = G(() => m.value === "signIn" ? `${t.value.name}登录` : m.value === "signUp" ? `${t.value.name}账号注册` : m.value === "resetPassword" ? `${t.value.name}密码重置` : "");
1970
+ return (y, f) => (g(), P("div", {
1971
+ class: "Title",
1972
+ style: ie({
1973
+ fontSize: n,
1974
+ lineHeight: r
1975
+ })
1976
+ }, [e(t).applicationLogoUrl ? (g(), P("img", {
1977
+ key: 0,
1978
+ src: e(t).applicationLogoUrl,
1979
+ srcset: "",
1980
+ style: ie({
1981
+ width: a
1982
+ })
1983
+ }, null, 12, li)) : S("", !0), z("span", null, R(l.value), 1), ue(y.$slots, "default", {}, void 0, !0)], 4));
1984
+ }
1985
+ }), ge = /* @__PURE__ */ $(si, [["__scopeId", "data-v-5576db64"]]), ni = {
1986
+ class: "Auth"
1987
+ }, ai = {
1988
+ class: "body"
1989
+ }, oi = /* @__PURE__ */ I({
1990
+ __name: "AuthkitAuth",
1991
+ props: {
1992
+ size: {
1993
+ type: String,
1994
+ required: !0
1995
+ },
1996
+ showTitle: {
1997
+ type: Boolean,
1998
+ default: () => !0
1999
+ }
2000
+ },
2001
+ emits: ["toPrivacyPolicy", "toUserServiceAgreement"],
2002
+ setup(u, {
2003
+ emit: o
2004
+ }) {
2005
+ const a = u, n = o, {
2006
+ signInSubmit: r,
2007
+ signUpSubmit: m,
2008
+ resetPasswordSubmit: t,
2009
+ currentView: l,
2010
+ authSignInLoading: y,
2011
+ authSignUpLoading: f,
2012
+ resetPasswordLoading: p,
2013
+ switchSignUp: d,
2014
+ switchResetPassword: c,
2015
+ switchSignIn: v
2016
+ } = Q(), {
2017
+ appsAuthPageInfoApi: b
2018
+ } = le();
2019
+ function U() {
2020
+ n("toPrivacyPolicy");
2021
+ }
2022
+ function C() {
2023
+ n("toUserServiceAgreement");
2024
+ }
2025
+ return b(), (T, B) => (g(), P("div", ni, [u.showTitle ? (g(), k(ge, {
2026
+ key: 0,
2027
+ size: 32,
2028
+ "font-size": 20
2029
+ })) : S("", !0), z("div", ai, [e(l) === "signIn" ? (g(), k(Yt, {
2030
+ key: 0,
2031
+ size: a.size,
2032
+ loading: e(y),
2033
+ onSwitchSignUp: e(d),
2034
+ onSwitchResetPassword: e(c),
2035
+ onSubmit: B[0] || (B[0] = (O) => e(r)(O))
2036
+ }, {
2037
+ OAuth: s(() => [i(Ct, {
2038
+ size: a.size
2039
+ }, null, 8, ["size"])]),
2040
+ _: 1
2041
+ }, 8, ["size", "loading", "onSwitchSignUp", "onSwitchResetPassword"])) : e(l) === "signUp" ? (g(), k(ii, {
2042
+ key: 1,
2043
+ size: a.size,
2044
+ loading: e(f),
2045
+ onSwitchSignIn: e(v),
2046
+ onSubmit: B[1] || (B[1] = (O) => e(m)(O))
2047
+ }, null, 8, ["size", "loading", "onSwitchSignIn"])) : e(l) === "resetPassword" ? (g(), k(Dt, {
2048
+ key: 2,
2049
+ size: a.size,
2050
+ loading: e(p),
2051
+ onSwitchSignIn: e(v),
2052
+ onSubmit: B[2] || (B[2] = (O) => e(t)(O))
2053
+ }, null, 8, ["size", "loading", "onSwitchSignIn"])) : S("", !0), i(Nt, {
2054
+ onToPrivacyPolicy: U,
2055
+ onToUserServiceAgreement: C
2056
+ })])]));
2057
+ }
2058
+ }), ri = /* @__PURE__ */ $(oi, [["__scopeId", "data-v-186d2441"]]), ui = /* @__PURE__ */ I({
2059
+ __name: "AuthkitAuthModal",
2060
+ props: {
2061
+ size: {
2062
+ type: String,
2063
+ required: !0
2064
+ },
2065
+ appId: {
2066
+ type: String,
2067
+ default: () => ""
2068
+ }
2069
+ },
2070
+ emits: ["confirm", "close", "toPrivacyPolicy", "toUserServiceAgreement"],
2071
+ setup(u, {
2072
+ emit: o
2073
+ }) {
2074
+ const {
2075
+ addSignInCallback: a
2076
+ } = Q(), {
2077
+ show: n
2078
+ } = Ue(), r = u, m = o;
2079
+ function t(y) {
2080
+ y(!0);
2081
+ }
2082
+ function l() {
2083
+ n.value = !1, m("close");
2084
+ }
2085
+ return a(() => {
2086
+ n.value = !1;
2087
+ }), (y, f) => (g(), k(e(me), {
2088
+ visible: e(n),
2089
+ "onUpdate:visible": f[2] || (f[2] = (p) => re(n) ? n.value = p : null),
2090
+ footer: !1,
2091
+ "mask-closable": !1,
2092
+ "title-align": "center",
2093
+ "unmount-on-close": "",
2094
+ width: "auto",
2095
+ "modal-class": "SignInModalClass",
2096
+ onBeforeOk: t,
2097
+ onClose: l
2098
+ }, {
2099
+ title: s(() => [i(ge)]),
2100
+ default: s(() => [i(ri, {
2101
+ "show-title": !1,
2102
+ size: r.size,
2103
+ onToPrivacyPolicy: f[0] || (f[0] = (p) => m("toPrivacyPolicy")),
2104
+ onToUserServiceAgreement: f[1] || (f[1] = (p) => m("toUserServiceAgreement"))
2105
+ }, null, 8, ["size"])]),
2106
+ _: 1
2107
+ }, 8, ["visible"]));
2108
+ }
2109
+ }), Pi = /* @__PURE__ */ $(ui, [["__scopeId", "data-v-6fbefff8"]]);
2110
+ export {
2111
+ Vi as A,
2112
+ fe as E,
2113
+ Ct as O,
2114
+ Rt as P,
2115
+ Dt as R,
2116
+ se as S,
2117
+ te as _,
2118
+ ri as a,
2119
+ ge as b,
2120
+ Pi as c,
2121
+ Yt as d,
2122
+ ii as e,
2123
+ Wt as f,
2124
+ ve as g,
2125
+ Jt as h,
2126
+ Nt as i,
2127
+ Ze as j,
2128
+ ne as k,
2129
+ ct as l,
2130
+ nt as m,
2131
+ mt as n,
2132
+ st as o
2133
+ };