@huyooo/ui 0.5.54 → 0.5.56

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