@huyooo/ui 0.11.2 → 0.11.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/AuthkitAppSetting-CSHkDxQT.js +1914 -0
  2. package/dist/{Clipboard---tG2Zxz.js → Clipboard-CRZDADLE.js} +1 -1
  3. package/dist/{Contact-BEUbBGiB.js → Contact-Y0Yczmc9.js} +8 -7
  4. package/dist/{CustomTable-CVZ4mFzi.js → CustomTable-BUkwlbzN.js} +3 -2
  5. package/dist/{FeedbackItem-CN041vTm.js → FeedbackItem-D7MpOmoM.js} +3 -3
  6. package/dist/FeedbackModal-CvNF1D-5.js +1050 -0
  7. package/dist/LandingPageFAQ-CZJXvor9.js +80 -0
  8. package/dist/LandingPageLinkGroup-DDNRivMt.js +521 -0
  9. package/dist/LandingPageSectionHeader-D_74W4My.js +69 -0
  10. package/dist/{LandingPageSectionTabs-B6ZVxR47.js → LandingPageSectionTabs-Ce3_Rc2L.js} +354 -426
  11. package/dist/MessageHandle-B12koVQL.js +924 -0
  12. package/dist/MessageList-Bo6YCfRO.js +233 -0
  13. package/dist/{MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-F6neJUg3.js → MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-DxDn6Ok8.js} +2 -2
  14. package/dist/PaySubscriptions-B8jAtG5n.js +515 -0
  15. package/dist/PricingPlans-CO26OcbJ.js +210 -0
  16. package/dist/ReferrerReferees-D_Iiw9wZ.js +106 -0
  17. package/dist/{Upload.vue_vue_type_script_setup_true_lang-D_-oMTOo.js → Upload.vue_vue_type_script_setup_true_lang-CbVSY_vt.js} +1 -1
  18. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-DpVadjMH.js +508 -0
  19. package/dist/WidthContainer-B6d4xrGT.js +693 -0
  20. package/dist/{apiClients-9b4zNZ2S.js → apiClients-DVz12LeW.js} +81 -75
  21. package/dist/authkit.d.ts +7 -0
  22. package/dist/authkit.js +52 -45
  23. package/dist/common/globalConfig.d.ts +2 -2
  24. package/dist/common/userMenuModal.d.ts +1 -0
  25. package/dist/common.js +2 -2
  26. package/dist/components/Authkit/AppSetting/AuthkitOAuthBinding.vue.d.ts +31 -0
  27. package/dist/components/Authkit/AppSetting/AuthkitPhoneBinding.vue.d.ts +14 -0
  28. package/dist/components/Authkit/AppSetting/AuthkitPhoneVerify.vue.d.ts +66 -0
  29. package/dist/components/Authkit/Auth/AuthkitBindPhone.vue.d.ts +27 -0
  30. package/dist/components/Authkit/Auth/AuthkitEmailUpdate.vue.d.ts +11 -1
  31. package/dist/components/Authkit/Auth/AuthkitOauthCallback.vue.d.ts +2 -2
  32. package/dist/components/Authkit/Auth/AuthkitOauthItem.vue.d.ts +1 -1
  33. package/dist/components/Authkit/Auth/AuthkitPasswordAuth.vue.d.ts +11 -1
  34. package/dist/components/Authkit/Auth/AuthkitPhonePasswordUpdateAndVerify.vue.d.ts +68 -0
  35. package/dist/components/Authkit/Auth/AuthkitSignInEmailCode.vue.d.ts +68 -0
  36. package/dist/components/Authkit/Auth/AuthkitSwitchSignUpOrResetPassword.vue.d.ts +15 -3
  37. package/dist/components/Authkit/AuthkitOAuthCallbackProvider.vue.d.ts +11 -0
  38. package/dist/components/Authkit/AuthkitProvider.vue.d.ts +45 -0
  39. package/dist/components/Feedback/FeedbackBubbleEnd.vue.d.ts +9 -0
  40. package/dist/components/Feedback/FeedbackBubbleStart.vue.d.ts +11 -6
  41. package/dist/components/LandingPage/LandingPageSections.vue.d.ts +1 -1
  42. package/dist/components/Pay/PaySubscriptions.vue.d.ts +2 -1
  43. package/dist/components/Pay/PricingFAQ.vue.d.ts +17 -0
  44. package/dist/components/Pay/PricingPlans.vue.d.ts +12 -0
  45. package/dist/components/UserMenu/UserMenuModals.vue.d.ts +2 -2
  46. package/dist/components/UserMenu/parts/UserSubscriptionBaseInformation.vue.d.ts +8 -0
  47. package/dist/composables/Authkit/useAuthkitAppsAuthPageInfo.d.ts +26 -0
  48. package/dist/composables/Authkit/useAuthkitAuth.d.ts +21 -9
  49. package/dist/composables/Authkit/useEnsureAuthenticated.d.ts +26 -0
  50. package/dist/composables/Authkit/useOauth.d.ts +4 -1
  51. package/dist/composables/Billing/useBillingPlans.d.ts +201 -0
  52. package/dist/composables/Billing/useBillingSubscriptionSummary.d.ts +280 -0
  53. package/dist/composables/Billing/useSubscriptionCheckout.d.ts +12 -0
  54. package/dist/composables/UserMenu/useUserMenu.d.ts +5 -1
  55. package/dist/composables.d.ts +2 -0
  56. package/dist/composables.js +25 -22
  57. package/dist/feedback.js +3 -3
  58. package/dist/index-D3Kp6R4z.js +4 -0
  59. package/dist/landingPage.js +42 -40
  60. package/dist/main.js +285 -269
  61. package/dist/message.js +19 -18
  62. package/dist/pay.d.ts +5 -0
  63. package/dist/pay.js +9 -2
  64. package/dist/privateCom.js +1 -1
  65. package/dist/referrer.js +1 -1
  66. package/dist/style.css +1 -1
  67. package/dist/types/api/auth.generated.d.ts +103 -39
  68. package/dist/types/api/billing.generated.d.ts +61 -28
  69. package/dist/types/api.d.ts +1 -1
  70. package/dist/types/app.d.ts +14 -0
  71. package/dist/upload.js +2 -2
  72. package/dist/{useAuthkitAppsAuthPageInfo-494yLvsu.js → useAuthkitAppsAuthPageInfo-Du5d6VK-.js} +20 -7
  73. package/dist/{useAuthkitCreateAndUpdate-DyRtFxZS.js → useAuthkitCreateAndUpdate-Bc9D5C6R.js} +1 -1
  74. package/dist/useAuthkitUsersProfile-CQGyvL7g.js +201 -0
  75. package/dist/{useDownloads-DaeIY0E9.js → useDownloads-BFx1a-f9.js} +1 -1
  76. package/dist/useEnsureAuthenticated-Cc64hF1O.js +2247 -0
  77. package/dist/{useLegalLinks-CPbWqlu6.js → useLegalLinks-Deksq9h-.js} +2 -2
  78. package/dist/{useMessageNotifications-Dg5q-C_o.js → useMessageNotifications-DY5xKtif.js} +1 -1
  79. package/dist/{useSEO-CXX9dcBx.js → useSEO-CvfzTZA9.js} +2 -2
  80. package/dist/useSubscriptionCheckout-BgQJN61l.js +345 -0
  81. package/dist/{useTableHandle-Cjq4gcC0.js → useTableHandle-D71P3Ez_.js} +1 -1
  82. package/dist/{useUploadCos-DiJmmbRf.js → useUploadCos-N5pim6q1.js} +501 -515
  83. package/dist/useUserMenu-ClPBlvaM.js +44 -0
  84. package/dist/user.js +12 -13
  85. package/dist/utils/apiMiddlewares.d.ts +6 -0
  86. package/package.json +1 -1
  87. package/dist/AuthkitAppSetting-BCrLMpLg.js +0 -1322
  88. package/dist/AuthkitSignInPhone-DmCQ2fWs.js +0 -1721
  89. package/dist/FeedbackModal-aI28o-w5.js +0 -1053
  90. package/dist/LandingPageSectionHeader-Cs1x8i3q.js +0 -584
  91. package/dist/MessageHandle-BV1nKlxs.js +0 -1147
  92. package/dist/PaySubscriptions-B3gI1Eme.js +0 -408
  93. package/dist/ReferrerReferees-DJzPo7X5.js +0 -106
  94. package/dist/UserAccountMenu-CJ9KKVYa.js +0 -371
  95. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-ClAXNSgl.js +0 -81
  96. package/dist/WidthContainer-BG10rumn.js +0 -669
  97. package/dist/useAuthkitUsersProfile-lGlQP54m.js +0 -186
  98. package/dist/useUserMenu-B3HKZKJ4.js +0 -43
@@ -1,1721 +0,0 @@
1
- import { defineComponent as b, openBlock as h, createBlock as $, unref as e, withCtx as p, createElementVNode as m, toDisplayString as x, createVNode as i, computed as R, createElementBlock as _, createTextVNode as P, createCommentVNode as k, ref as w, useSlots as Y, renderSlot as D, normalizeStyle as N, onMounted as Z, onUnmounted as se } from "vue";
2
- import { _ as I } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
- /* empty css */
4
- /* empty css */
5
- /* empty css */
6
- import { Button as O, Divider as oe, Form as F, FormItem as z, Input as A, Link as L, Modal as ne, List as ae, ListItem as j, ListItemMeta as W, Avatar as G } from "@arco-design/web-vue";
7
- import { u as E, a as re } from "./useAuthkitUsersProfile-lGlQP54m.js";
8
- import { g as J, e as U, u as le } from "./apiClients-9b4zNZ2S.js";
9
- import { u as Q } from "./useAuthkitAppsAuthPageInfo-494yLvsu.js";
10
- import { Icon as ue } from "@iconify/vue";
11
- /* empty css */
12
- /* empty css */
13
- import { S as M, a as de } from "./AuthkitAppSetting-BCrLMpLg.js";
14
- import { u as ce } from "./useLegalLinks-CPbWqlu6.js";
15
- /* empty css */
16
- /* empty css */
17
- function ee() {
18
- return J.oauthCallbackUrl ? J.oauthCallbackUrl : `${window.location.origin}/auth/callback`;
19
- }
20
- function pe() {
21
- const d = window.location.pathname + window.location.search;
22
- d.includes("/auth/callback") || sessionStorage.setItem("auth_redirect", d);
23
- }
24
- async function H(d, u) {
25
- const s = J.appId;
26
- if (!s) {
27
- console.error(`${d} OAuth 失败: appId 未配置`);
28
- return;
29
- }
30
- const n = ee(), c = {
31
- appId: s,
32
- referrerId: u == null ? void 0 : u.referrerId,
33
- redirectUri: n
34
- };
35
- pe();
36
- const r = {
37
- github: () => U.oauth.github.login.get(c),
38
- google: () => U.oauth.google.login.get(c),
39
- microsoft: () => U.oauth.microsoft.login.get(c)
40
- };
41
- try {
42
- const {
43
- data: o
44
- } = await r[d]();
45
- o != null && o.redirectUri ? window.location.href = o.redirectUri : console.error(`${d} OAuth 重定向URL为空`);
46
- } catch (o) {
47
- console.error(`${d} OAuth 授权失败:`, o);
48
- }
49
- }
50
- function me(d) {
51
- H("github", {
52
- referrerId: d
53
- });
54
- }
55
- function fe(d) {
56
- H("google", {
57
- referrerId: d
58
- });
59
- }
60
- function ge(d) {
61
- H("microsoft", {
62
- referrerId: d
63
- });
64
- }
65
- function ve() {
66
- return {
67
- githubAuth: me,
68
- googleAuth: fe,
69
- microsoftAuth: ge,
70
- startOauth: H,
71
- getOauthCallbackUrl: ee
72
- };
73
- }
74
- const K = /* @__PURE__ */ b({
75
- __name: "AuthkitOauthItem",
76
- props: {
77
- size: {
78
- type: String,
79
- required: !0
80
- },
81
- icon: {
82
- type: String,
83
- required: !0,
84
- default: () => ""
85
- },
86
- label: {
87
- type: String,
88
- required: !0,
89
- default: () => ""
90
- }
91
- },
92
- emits: [],
93
- setup(d, {
94
- emit: u
95
- }) {
96
- const s = d;
97
- return (n, c) => (h(), $(e(O), {
98
- class: "OAuthItem",
99
- type: "primary",
100
- size: s.size
101
- }, {
102
- icon: p(() => [i(e(ue), {
103
- icon: s.icon
104
- }, null, 8, ["icon"])]),
105
- default: p(() => [m("span", null, x(s.label), 1)]),
106
- _: 1
107
- }, 8, ["size"]));
108
- }
109
- }), he = {
110
- class: "OAuthList"
111
- }, ye = {
112
- class: "OAuthList"
113
- }, _e = /* @__PURE__ */ b({
114
- __name: "AuthkitOauthList",
115
- props: {
116
- size: {
117
- type: String,
118
- default: () => "large"
119
- },
120
- appId: {
121
- type: String,
122
- default: () => ""
123
- }
124
- },
125
- setup(d) {
126
- const {
127
- appsData: u
128
- } = Q(), s = d, {
129
- githubAuth: n,
130
- googleAuth: c,
131
- microsoftAuth: r
132
- } = ve(), o = R(() => !(!u.value.oauth.google.enabled && !u.value.oauth.microsoft.enabled && !u.value.oauth.github.enabled && !u.value.oauth.wechat.enabled));
133
- return (t, v) => (h(), _("div", he, [o.value ? (h(), $(e(oe), {
134
- key: 0,
135
- orientation: "center"
136
- }, {
137
- default: p(() => [...v[3] || (v[3] = [P("OAuth登陆", -1)])]),
138
- _: 1
139
- })) : k("", !0), m("div", ye, [e(u).oauth.github.enabled ? (h(), $(K, {
140
- key: 0,
141
- icon: "mdi:github",
142
- label: "Github",
143
- size: s.size,
144
- onClick: v[0] || (v[0] = (l) => e(n)())
145
- }, null, 8, ["size"])) : k("", !0), e(u).oauth.google.enabled ? (h(), $(K, {
146
- key: 1,
147
- icon: "mdi:google",
148
- label: "Google",
149
- size: s.size,
150
- onClick: v[1] || (v[1] = (l) => e(c)())
151
- }, null, 8, ["size"])) : k("", !0), e(u).oauth.microsoft.enabled ? (h(), $(K, {
152
- key: 2,
153
- icon: "mdi:microsoft",
154
- label: "Microsoft",
155
- size: s.size,
156
- onClick: v[2] || (v[2] = (l) => e(r)())
157
- }, null, 8, ["size"])) : k("", !0)])]));
158
- }
159
- }), we = /* @__PURE__ */ I(_e, [["__scopeId", "data-v-886fd902"]]), Se = {
160
- class: "content"
161
- }, be = {
162
- class: "sendVerifyCodeItem"
163
- }, ke = {
164
- class: "handle"
165
- }, Ie = /* @__PURE__ */ b({
166
- __name: "AuthkitPasswordUpdateAndVerify",
167
- props: {
168
- size: {
169
- type: String,
170
- required: !0
171
- },
172
- loading: {
173
- type: Boolean,
174
- required: !0,
175
- default: () => !0
176
- }
177
- },
178
- emits: ["signIn", "submit"],
179
- setup(d, {
180
- emit: u
181
- }) {
182
- const s = u, n = d, c = w(), r = w(!1), o = w(), t = w({
183
- email: void 0,
184
- userToken: void 0,
185
- emailVerifyId: void 0,
186
- password: void 0,
187
- confirmPassword: void 0
188
- });
189
- async function v() {
190
- if (!await o.value.validateField(["email"])) {
191
- r.value = !0;
192
- const {
193
- data: g
194
- } = await U.verify.email.retry.post({
195
- email: t.value.email
196
- });
197
- r.value = !1, g && (t.value.emailVerifyId = g.emailVerifyId, c.value.startCountFn());
198
- }
199
- }
200
- async function l() {
201
- o.value.validate().then((y) => {
202
- y || s("submit", t.value);
203
- });
204
- }
205
- return (y, g) => (h(), _("div", Se, [i(e(F), {
206
- ref_key: "formRef",
207
- ref: o,
208
- model: t.value,
209
- size: n.size,
210
- "auto-label-width": ""
211
- }, {
212
- default: p(() => [i(e(z), {
213
- field: "email",
214
- label: "邮箱",
215
- "hide-label": "",
216
- rules: [{
217
- required: !0,
218
- message: "请输入邮箱"
219
- }, {
220
- type: "email",
221
- message: "请输入有效的邮箱"
222
- }]
223
- }, {
224
- default: p(() => [i(e(A), {
225
- modelValue: t.value.email,
226
- "onUpdate:modelValue": g[0] || (g[0] = (a) => t.value.email = a),
227
- placeholder: "请输入邮箱"
228
- }, null, 8, ["modelValue"])]),
229
- _: 1
230
- }), i(e(z), {
231
- field: "userToken",
232
- label: "验证码",
233
- "hide-label": "",
234
- rules: [{
235
- required: !0,
236
- message: "请输入验证码"
237
- }]
238
- }, {
239
- default: p(() => [m("div", be, [i(e(A), {
240
- modelValue: t.value.userToken,
241
- "onUpdate:modelValue": g[1] || (g[1] = (a) => t.value.userToken = a),
242
- placeholder: "请输入验证码"
243
- }, null, 8, ["modelValue"]), i(M, {
244
- ref_key: "SendVerifyCodeRef",
245
- ref: c,
246
- size: n.size,
247
- loading: r.value,
248
- style: {
249
- "margin-left": "10px"
250
- },
251
- onSend: v
252
- }, null, 8, ["size", "loading"])])]),
253
- _: 1
254
- }), i(e(z), {
255
- field: "password",
256
- label: "密码",
257
- "hide-label": "",
258
- rules: [{
259
- required: !0,
260
- message: "密码请输入"
261
- }, {
262
- minLength: 10,
263
- message: "密码不能少于10字符"
264
- }]
265
- }, {
266
- default: p(() => [i(e(A), {
267
- modelValue: t.value.password,
268
- "onUpdate:modelValue": g[2] || (g[2] = (a) => t.value.password = a),
269
- placeholder: "请输入密码",
270
- type: "password",
271
- autocomplete: ""
272
- }, null, 8, ["modelValue"])]),
273
- _: 1
274
- }), i(e(z), {
275
- field: "confirmPassword",
276
- label: "确认密码",
277
- "hide-label": "",
278
- rules: [{
279
- required: !0,
280
- message: "请输入确认密码"
281
- }, {
282
- minLength: 10,
283
- message: "确认密码不能少于10字符"
284
- }, {
285
- validator: (a, f) => {
286
- a !== t.value.password ? f("两次密码输入不一致,请重新输入") : f();
287
- }
288
- }]
289
- }, {
290
- default: p(() => [i(e(A), {
291
- modelValue: t.value.confirmPassword,
292
- "onUpdate:modelValue": g[3] || (g[3] = (a) => t.value.confirmPassword = a),
293
- placeholder: "请输入确认密码密码",
294
- type: "password",
295
- autocomplete: ""
296
- }, null, 8, ["modelValue"])]),
297
- _: 1
298
- }, 8, ["rules"]), m("div", ke, [i(e(O), {
299
- type: "primary",
300
- loading: n.loading,
301
- long: "",
302
- size: n.size,
303
- onClick: l
304
- }, {
305
- default: p(() => [...g[4] || (g[4] = [P(" 提交 ", -1)])]),
306
- _: 1
307
- }, 8, ["loading", "size"])])]),
308
- _: 1
309
- }, 8, ["model", "size"])]));
310
- }
311
- }), ze = /* @__PURE__ */ I(Ie, [["__scopeId", "data-v-50b04889"]]), Ae = {
312
- class: "SwitchSignIn"
313
- }, Pe = /* @__PURE__ */ b({
314
- __name: "AuthkitSwitchSignIn",
315
- emits: ["switchSignIn"],
316
- setup(d, {
317
- emit: u
318
- }) {
319
- const s = u;
320
- function n() {
321
- s("switchSignIn");
322
- }
323
- return (c, r) => (h(), _("div", Ae, [m("span", null, [r[1] || (r[1] = m("span", null, "已经有账号?", -1)), i(e(L), {
324
- style: {
325
- padding: "0px"
326
- },
327
- onClick: n
328
- }, {
329
- default: p(() => [...r[0] || (r[0] = [P("去登陆", -1)])]),
330
- _: 1
331
- })])]));
332
- }
333
- }), X = /* @__PURE__ */ I(Pe, [["__scopeId", "data-v-fc1d3903"]]), Ve = {
334
- class: "ResetPassword"
335
- }, $e = /* @__PURE__ */ b({
336
- __name: "AuthkitResetPassword",
337
- props: {
338
- size: {
339
- type: String,
340
- required: !0,
341
- default: () => "large"
342
- },
343
- loading: {
344
- type: Boolean,
345
- required: !0,
346
- default: () => !0
347
- }
348
- },
349
- emits: ["switchSignIn", "submit"],
350
- setup(d, {
351
- emit: u
352
- }) {
353
- const s = u, n = d;
354
- function c() {
355
- s("switchSignIn");
356
- }
357
- async function r(o) {
358
- s("submit", o);
359
- }
360
- return (o, t) => (h(), _("div", Ve, [i(ze, {
361
- loading: d.loading,
362
- size: n.size,
363
- onSubmit: r
364
- }, null, 8, ["loading", "size"]), i(X, {
365
- onSwitchSignIn: c
366
- })]));
367
- }
368
- }), Ue = /* @__PURE__ */ I($e, [["__scopeId", "data-v-0622cbe3"]]), Ce = {
369
- key: 0,
370
- class: "ServiceAgreementAndPrivacyProtection"
371
- }, qe = {
372
- key: 1
373
- }, Re = /* @__PURE__ */ b({
374
- __name: "AuthkitServiceAgreementAndPrivacyProtection",
375
- emits: ["toUserServiceAgreement", "toPrivacyPolicy"],
376
- setup(d, {
377
- emit: u
378
- }) {
379
- const s = u, {
380
- getLink: n
381
- } = ce(), c = R(() => {
382
- const l = n("userServiceAgreement");
383
- return l != null && l.configured ? l : void 0;
384
- }), r = R(() => {
385
- const l = n("privacyPolicy");
386
- return l != null && l.configured ? l : void 0;
387
- }), o = R(() => !!(c.value || r.value));
388
- function t() {
389
- s("toUserServiceAgreement");
390
- }
391
- function v() {
392
- s("toPrivacyPolicy");
393
- }
394
- return (l, y) => o.value ? (h(), _("div", Ce, [y[0] || (y[0] = m("span", null, "注册登陆即表示同意", -1)), c.value ? (h(), $(e(L), {
395
- key: 0,
396
- onClick: t
397
- }, {
398
- default: p(() => [P(x(c.value.label), 1)]),
399
- _: 1
400
- })) : k("", !0), c.value && r.value ? (h(), _("span", qe, "和")) : k("", !0), r.value ? (h(), $(e(L), {
401
- key: 2,
402
- onClick: v
403
- }, {
404
- default: p(() => [P(x(r.value.label), 1)]),
405
- _: 1
406
- })) : k("", !0)])) : k("", !0);
407
- }
408
- }), xe = /* @__PURE__ */ I(Re, [["__scopeId", "data-v-c45a9ad9"]]), Oe = {
409
- class: "content"
410
- }, Te = {
411
- class: "handle"
412
- }, Be = /* @__PURE__ */ b({
413
- __name: "AuthkitPasswordAuth",
414
- props: {
415
- size: {
416
- type: String,
417
- required: !0
418
- },
419
- loading: {
420
- type: Boolean,
421
- required: !0,
422
- default: () => !0
423
- }
424
- },
425
- emits: ["submit"],
426
- setup(d, {
427
- emit: u
428
- }) {
429
- const s = u, n = d;
430
- async function c(v, l) {
431
- var T;
432
- if (!v) {
433
- l("请输入密码");
434
- return;
435
- }
436
- const {
437
- data: y,
438
- error: g
439
- } = await U.verify.password.post({
440
- password: v
441
- });
442
- if (g) {
443
- l(g.message || "密码验证请求出错!");
444
- return;
445
- }
446
- if (!y) {
447
- l("密码验证请求出错!");
448
- return;
449
- }
450
- const {
451
- isPass: a,
452
- feedback: f,
453
- score: S,
454
- minPasswordComplexity: V
455
- } = y;
456
- if (!(a === !0 || a === "true" || typeof a == "boolean" && a)) {
457
- const C = (f == null ? void 0 : f.warning) || ((T = f == null ? void 0 : f.suggestions) != null && T.length ? f.suggestions.join(", ") : "") || "密码强度不足";
458
- l(C);
459
- return;
460
- }
461
- l();
462
- }
463
- const r = w(), o = w({
464
- email: void 0,
465
- password: void 0
466
- });
467
- async function t() {
468
- r.value.validate().then((v) => {
469
- v || s("submit", o.value);
470
- });
471
- }
472
- return (v, l) => (h(), _("div", Oe, [i(e(F), {
473
- ref_key: "formRef",
474
- ref: r,
475
- model: o.value,
476
- size: n.size,
477
- "auto-label-width": ""
478
- }, {
479
- default: p(() => [i(e(z), {
480
- field: "email",
481
- label: "邮箱",
482
- "hide-label": "",
483
- rules: [{
484
- required: !0,
485
- message: "请输入邮箱"
486
- }, {
487
- type: "email",
488
- message: "请输入有效的邮箱"
489
- }]
490
- }, {
491
- default: p(() => [i(e(A), {
492
- modelValue: o.value.email,
493
- "onUpdate:modelValue": l[0] || (l[0] = (y) => o.value.email = y),
494
- placeholder: "请输入邮箱",
495
- autocomplete: "email username",
496
- type: "email"
497
- }, null, 8, ["modelValue"])]),
498
- _: 1
499
- }), i(e(z), {
500
- field: "password",
501
- label: "密码",
502
- "hide-label": "",
503
- rules: [{
504
- required: !0,
505
- message: "请输入密码"
506
- }, {
507
- validator: c
508
- }]
509
- }, {
510
- default: p(() => [i(e(A), {
511
- modelValue: o.value.password,
512
- "onUpdate:modelValue": l[1] || (l[1] = (y) => o.value.password = y),
513
- placeholder: "请输入密码",
514
- type: "password",
515
- autocomplete: "current-password"
516
- }, null, 8, ["modelValue"])]),
517
- _: 1
518
- }, 8, ["rules"]), m("div", Te, [i(e(O), {
519
- type: "primary",
520
- loading: n.loading,
521
- long: "",
522
- size: n.size,
523
- onClick: t
524
- }, {
525
- default: p(() => [...l[2] || (l[2] = [P(" 登陆 ", -1)])]),
526
- _: 1
527
- }, 8, ["loading", "size"])])]),
528
- _: 1
529
- }, 8, ["model", "size"])]));
530
- }
531
- }), Le = /* @__PURE__ */ I(Be, [["__scopeId", "data-v-a5b44bae"]]), Fe = {
532
- class: "SwitchSignUpOrResetPassword"
533
- }, Me = /* @__PURE__ */ b({
534
- __name: "AuthkitSwitchSignUpOrResetPassword",
535
- emits: ["switchSignUp", "switchResetPassword"],
536
- setup(d, {
537
- emit: u
538
- }) {
539
- const s = u;
540
- function n() {
541
- s("switchSignUp");
542
- }
543
- function c() {
544
- s("switchResetPassword");
545
- }
546
- return (r, o) => (h(), _("div", Fe, [m("span", null, [o[1] || (o[1] = m("span", null, " 还没有账户?", -1)), i(e(L), {
547
- style: {
548
- padding: "0px"
549
- },
550
- onClick: n
551
- }, {
552
- default: p(() => [...o[0] || (o[0] = [P("去注册?", -1)])]),
553
- _: 1
554
- })]), i(e(L), {
555
- style: {
556
- padding: "0px"
557
- },
558
- onClick: c
559
- }, {
560
- default: p(() => [...o[2] || (o[2] = [P(" 忘记密码?", -1)])]),
561
- _: 1
562
- })]));
563
- }
564
- }), te = /* @__PURE__ */ I(Me, [["__scopeId", "data-v-14e3aab2"]]), Ne = {
565
- class: "SignIn"
566
- }, De = /* @__PURE__ */ b({
567
- __name: "AuthkitSignIn",
568
- props: {
569
- size: {
570
- type: String,
571
- required: !0
572
- },
573
- loading: {
574
- type: Boolean,
575
- required: !0,
576
- default: () => !0
577
- }
578
- },
579
- emits: ["submit", "switchSignUp", "switchResetPassword"],
580
- setup(d, {
581
- emit: u
582
- }) {
583
- const s = u, n = d, c = Y(), r = R(() => !!c.OAuth);
584
- function o() {
585
- s("switchSignUp");
586
- }
587
- function t() {
588
- s("switchResetPassword");
589
- }
590
- async function v(l) {
591
- s("submit", l);
592
- }
593
- return (l, y) => (h(), _("div", Ne, [k("", !0), i(Le, {
594
- loading: n.loading,
595
- size: n.size,
596
- onSubmit: v
597
- }, null, 8, ["loading", "size"]), r.value ? D(l.$slots, "OAuth", {
598
- key: 1
599
- }, void 0, !0) : k("", !0), i(te, {
600
- onSwitchSignUp: o,
601
- onSwitchResetPassword: t
602
- })]));
603
- }
604
- }), Ee = /* @__PURE__ */ I(De, [["__scopeId", "data-v-f52ce3b3"]]), He = {
605
- class: "SignUp"
606
- }, je = /* @__PURE__ */ b({
607
- __name: "AuthkitSignUp",
608
- props: {
609
- size: {
610
- type: String,
611
- required: !0
612
- },
613
- loading: {
614
- type: Boolean,
615
- required: !0,
616
- default: () => !0
617
- }
618
- },
619
- emits: ["switchSignIn", "submit"],
620
- setup(d, {
621
- emit: u
622
- }) {
623
- const s = u, n = d;
624
- function c() {
625
- s("switchSignIn");
626
- }
627
- async function r(o) {
628
- s("submit", o);
629
- }
630
- return (o, t) => (h(), _("div", He, [i(de, {
631
- size: n.size,
632
- loading: d.loading,
633
- onSubmit: r
634
- }, null, 8, ["size", "loading"]), i(X, {
635
- onSwitchSignIn: c
636
- })]));
637
- }
638
- }), We = /* @__PURE__ */ I(je, [["__scopeId", "data-v-058bbbef"]]), Ge = ["src"], Ke = /* @__PURE__ */ b({
639
- __name: "AuthkitAuthTitle",
640
- props: {
641
- size: {
642
- type: [String, Number],
643
- required: !1,
644
- default: 30
645
- },
646
- fontSize: {
647
- type: Number,
648
- required: !1,
649
- default: 18
650
- },
651
- lineHeight: {
652
- type: Number,
653
- required: !1,
654
- default: 60
655
- }
656
- },
657
- setup(d) {
658
- const u = d, s = `${u.size}px`, n = `${u.fontSize}px`, c = `${u.lineHeight}px`, {
659
- currentView: r
660
- } = E(), {
661
- appsData: o
662
- } = Q(), t = R(() => r.value === "signIn" ? `${o.value.name}登录` : r.value === "signUp" ? `${o.value.name}账号注册` : r.value === "resetPassword" ? `${o.value.name}密码重置` : "");
663
- return (v, l) => (h(), _("div", {
664
- class: "Title",
665
- style: N({
666
- fontSize: n,
667
- lineHeight: c
668
- })
669
- }, [e(o).applicationLogoUrl ? (h(), _("img", {
670
- key: 0,
671
- src: e(o).applicationLogoUrl,
672
- srcset: "",
673
- style: N({
674
- width: s
675
- })
676
- }, null, 12, Ge)) : k("", !0), m("span", null, x(t.value), 1), D(v.$slots, "default", {}, void 0, !0)], 4));
677
- }
678
- }), ie = /* @__PURE__ */ I(Ke, [["__scopeId", "data-v-8ebe7939"]]), Je = {
679
- class: "Auth"
680
- }, Qe = {
681
- class: "body"
682
- }, Xe = /* @__PURE__ */ b({
683
- __name: "AuthkitAuth",
684
- props: {
685
- size: {
686
- type: String,
687
- required: !0
688
- },
689
- showTitle: {
690
- type: Boolean,
691
- default: () => !0
692
- }
693
- },
694
- emits: ["toPrivacyPolicy", "toUserServiceAgreement"],
695
- setup(d, {
696
- emit: u
697
- }) {
698
- const s = d, n = u, {
699
- signInSubmit: c,
700
- signUpSubmit: r,
701
- resetPasswordSubmit: o,
702
- currentView: t,
703
- authSignInLoading: v,
704
- authSignUpLoading: l,
705
- resetPasswordLoading: y,
706
- switchSignUp: g,
707
- switchResetPassword: a,
708
- switchSignIn: f
709
- } = E(), {
710
- appsAuthPageInfoApi: S
711
- } = Q();
712
- function V() {
713
- n("toPrivacyPolicy");
714
- }
715
- function q() {
716
- n("toUserServiceAgreement");
717
- }
718
- return S(), (T, C) => (h(), _("div", Je, [d.showTitle ? (h(), $(ie, {
719
- key: 0,
720
- size: 32,
721
- "font-size": 20
722
- })) : k("", !0), m("div", Qe, [e(t) === "signIn" ? (h(), $(Ee, {
723
- key: 0,
724
- size: s.size,
725
- loading: e(v),
726
- onSwitchSignUp: e(g),
727
- onSwitchResetPassword: e(a),
728
- onSubmit: C[0] || (C[0] = (B) => e(c)(B))
729
- }, {
730
- OAuth: p(() => [i(we, {
731
- size: s.size
732
- }, null, 8, ["size"])]),
733
- _: 1
734
- }, 8, ["size", "loading", "onSwitchSignUp", "onSwitchResetPassword"])) : e(t) === "signUp" ? (h(), $(We, {
735
- key: 1,
736
- size: s.size,
737
- loading: e(l),
738
- onSwitchSignIn: e(f),
739
- onSubmit: C[1] || (C[1] = (B) => e(r)(B))
740
- }, null, 8, ["size", "loading", "onSwitchSignIn"])) : e(t) === "resetPassword" ? (h(), $(Ue, {
741
- key: 2,
742
- size: s.size,
743
- loading: e(y),
744
- onSwitchSignIn: e(f),
745
- onSubmit: C[2] || (C[2] = (B) => e(o)(B))
746
- }, null, 8, ["size", "loading", "onSwitchSignIn"])) : k("", !0), i(xe, {
747
- onToPrivacyPolicy: V,
748
- onToUserServiceAgreement: q
749
- })])]));
750
- }
751
- }), Ye = /* @__PURE__ */ I(Xe, [["__scopeId", "data-v-de36d1d1"]]), Ze = {
752
- class: "header"
753
- }, et = ["href"], tt = {
754
- class: "container"
755
- }, it = /* @__PURE__ */ b({
756
- __name: "AuthkitAuthContainer",
757
- props: {
758
- applicationLogoUrl: {
759
- type: String,
760
- required: !0,
761
- default: () => ""
762
- },
763
- name: {
764
- type: String,
765
- required: !0,
766
- default: () => ""
767
- },
768
- description: {
769
- type: String,
770
- required: !0,
771
- default: () => ""
772
- },
773
- appHomePage: {
774
- type: String,
775
- required: !0,
776
- default: () => ""
777
- },
778
- backgroundImage: {
779
- type: String,
780
- required: !0,
781
- default: () => ""
782
- },
783
- backgroundColor: {
784
- type: String,
785
- required: !0,
786
- default: () => ""
787
- },
788
- linkColor: {
789
- type: String,
790
- default: "var(--huyooo-accent-primary)"
791
- },
792
- backgroundType: {
793
- type: String,
794
- default: "color"
795
- }
796
- },
797
- setup(d) {
798
- const u = d, s = R(() => u.backgroundType === "color" ? {
799
- backgroundColor: u.backgroundColor
800
- } : {
801
- backgroundImage: `url(${u.backgroundImage})`
802
- });
803
- return (n, c) => (h(), _("div", {
804
- class: "auth",
805
- style: N(s.value)
806
- }, [m("div", Ze, [u.name ? (h(), _("a", {
807
- key: 0,
808
- href: u.appHomePage,
809
- target: "_self",
810
- class: "link",
811
- style: N({
812
- color: u.linkColor
813
- })
814
- }, " 返回主页 ", 12, et)) : k("", !0)]), m("div", tt, [D(n.$slots, "default", {}, void 0, !0)])], 4));
815
- }
816
- }), Zt = /* @__PURE__ */ I(it, [["__scopeId", "data-v-0e13d3ff"]]), st = /* @__PURE__ */ b({
817
- __name: "AuthkitAuthModal",
818
- props: {
819
- size: {
820
- default: "large"
821
- }
822
- },
823
- emits: ["close", "toPrivacyPolicy", "toUserServiceAgreement"],
824
- setup(d, {
825
- emit: u
826
- }) {
827
- const s = u, {
828
- onSignIn: n
829
- } = E(), {
830
- isOpen: c,
831
- close: r
832
- } = le();
833
- let o = null;
834
- Z(() => {
835
- o = n(() => r());
836
- }), se(() => {
837
- o == null || o(), o = null;
838
- });
839
- function t(l) {
840
- l || r();
841
- }
842
- function v() {
843
- r(), s("close");
844
- }
845
- return (l, y) => (h(), $(e(ne), {
846
- visible: e(c),
847
- footer: !1,
848
- "mask-closable": !1,
849
- "title-align": "center",
850
- "unmount-on-close": "",
851
- width: "auto",
852
- "modal-class": "SignInModalClass",
853
- "onUpdate:visible": t,
854
- onClose: v
855
- }, {
856
- title: p(() => [i(ie)]),
857
- default: p(() => [i(Ye, {
858
- "show-title": !1,
859
- size: d.size,
860
- onToPrivacyPolicy: y[0] || (y[0] = (g) => s("toPrivacyPolicy")),
861
- onToUserServiceAgreement: y[1] || (y[1] = (g) => s("toUserServiceAgreement"))
862
- }, null, 8, ["size"])]),
863
- _: 1
864
- }, 8, ["visible"]));
865
- }
866
- }), ei = /* @__PURE__ */ I(st, [["__scopeId", "data-v-e2b88450"]]), ot = {
867
- class: "box"
868
- }, nt = {
869
- class: "title"
870
- }, at = {
871
- class: "content"
872
- }, rt = {
873
- class: "redirect"
874
- }, lt = {
875
- style: {
876
- "font-weight": "bold",
877
- "font-size": "12px"
878
- }
879
- }, ut = /* @__PURE__ */ b({
880
- __name: "AuthkitAuthorize",
881
- props: {
882
- size: {
883
- type: String,
884
- required: !0
885
- },
886
- title: {
887
- type: String,
888
- required: !0,
889
- default: () => "授权登录"
890
- },
891
- logo: {
892
- type: String,
893
- required: !0,
894
- default: () => ""
895
- },
896
- clientId: {
897
- type: String,
898
- required: !0,
899
- default: () => ""
900
- },
901
- responseType: {
902
- type: String,
903
- required: !0,
904
- default: () => ""
905
- },
906
- scope: {
907
- type: String,
908
- required: !0,
909
- default: () => ""
910
- },
911
- state: {
912
- type: String,
913
- required: !0,
914
- default: () => ""
915
- },
916
- redirectUri: {
917
- type: String,
918
- required: !0,
919
- default: () => ""
920
- },
921
- userInfo: {
922
- type: Object,
923
- required: !0,
924
- default: () => ""
925
- }
926
- },
927
- setup(d) {
928
- const u = w(!1), s = d, n = w({
929
- appKey: "",
930
- name: "",
931
- homePageUrl: "",
932
- createAt: "",
933
- authorizationCallback: ""
934
- });
935
- async function c() {
936
- const {
937
- data: o
938
- } = await U.apps.findOne.post({
939
- id: s.clientId
940
- });
941
- o && (n.value = o);
942
- }
943
- c();
944
- async function r() {
945
- u.value = !0;
946
- const {
947
- data: o
948
- } = await U.oauth2.authorize.post({
949
- client_id: s.clientId,
950
- response_type: s.responseType,
951
- scope: s.scope,
952
- state: s.state,
953
- redirect_uri: s.redirectUri
954
- });
955
- u.value = !1, o && (window.location = o.authorizeUrl);
956
- }
957
- return (o, t) => (h(), _("div", ot, [m("div", nt, x(`授权 ${n.value.name}`), 1), m("div", at, [i(e(ae), null, {
958
- default: p(() => [i(e(j), null, {
959
- default: p(() => {
960
- var v;
961
- return [i(e(W), {
962
- title: n.value.name,
963
- description: `想要使用您的${(v = s.userInfo) == null ? void 0 : v.nickname}账户`
964
- }, {
965
- avatar: p(() => {
966
- var l;
967
- return [i(e(G), {
968
- shape: "square",
969
- "image-url": (l = s.userInfo) == null ? void 0 : l.avatar
970
- }, null, 8, ["image-url"])];
971
- }),
972
- _: 1
973
- }, 8, ["title", "description"])];
974
- }),
975
- _: 1
976
- }), i(e(j), null, {
977
- default: p(() => [i(e(W), {
978
- title: "公开信息",
979
- description: "头像、昵称"
980
- }, {
981
- avatar: p(() => [i(e(G), {
982
- shape: "square"
983
- }, {
984
- default: p(() => [...t[0] || (t[0] = [m("img", {
985
- alt: "avatar",
986
- src: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp"
987
- }, null, -1)])]),
988
- _: 1
989
- })]),
990
- _: 1
991
- })]),
992
- _: 1
993
- }), i(e(j), null, {
994
- default: p(() => [i(e(W), {
995
- title: "个人用户数据",
996
- description: "电子邮件地址"
997
- }, {
998
- avatar: p(() => [i(e(G), {
999
- shape: "square"
1000
- }, {
1001
- default: p(() => [...t[1] || (t[1] = [m("img", {
1002
- alt: "avatar",
1003
- src: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp"
1004
- }, null, -1)])]),
1005
- _: 1
1006
- })]),
1007
- _: 1
1008
- })]),
1009
- _: 1
1010
- })]),
1011
- _: 1
1012
- }), i(e(O), {
1013
- type: "primary",
1014
- size: s.size,
1015
- loading: u.value,
1016
- onClick: r
1017
- }, {
1018
- default: p(() => [...t[2] || (t[2] = [P(" 授权 ", -1)])]),
1019
- _: 1
1020
- }, 8, ["size", "loading"]), m("div", rt, [t[3] || (t[3] = m("div", {
1021
- class: "redirect-hint"
1022
- }, "授权后将跳转至", -1)), m("div", lt, x(n.value.authorizationCallback), 1)])])]));
1023
- }
1024
- }), ti = /* @__PURE__ */ I(ut, [["__scopeId", "data-v-5665e1c4"]]), dt = {
1025
- class: "oauth-callback"
1026
- }, ct = {
1027
- key: 0,
1028
- class: "callback-loading"
1029
- }, pt = {
1030
- key: 1,
1031
- class: "callback-error"
1032
- }, mt = {
1033
- key: 2,
1034
- class: "callback-success"
1035
- }, ft = /* @__PURE__ */ b({
1036
- __name: "AuthkitOauthCallback",
1037
- props: {
1038
- defaultRedirect: {},
1039
- loadingText: {},
1040
- bindIdentityRedirect: {}
1041
- },
1042
- emits: ["success", "error", "needBindIdentity"],
1043
- setup(d, {
1044
- emit: u
1045
- }) {
1046
- const s = d, n = u, c = w(!0), r = w(""), {
1047
- setToken: o,
1048
- restoreSession: t
1049
- } = E(), {
1050
- fetchUserProfile: v
1051
- } = re();
1052
- async function l() {
1053
- const g = new URLSearchParams(window.location.search), a = g.get("error");
1054
- if (a) {
1055
- r.value = decodeURIComponent(a), c.value = !1, n("error", r.value);
1056
- return;
1057
- }
1058
- const f = g.get("token"), S = g.get("userId"), V = g.get("appId"), q = g.get("needBindIdentity") === "true";
1059
- if (!f) {
1060
- r.value = "登录失败:未收到认证令牌", c.value = !1, n("error", r.value);
1061
- return;
1062
- }
1063
- try {
1064
- o(f), await v();
1065
- const T = window.location.pathname;
1066
- if (window.history.replaceState({}, "", T), q && (n("needBindIdentity", {
1067
- token: f,
1068
- userId: S || "",
1069
- appId: V || ""
1070
- }), s.bindIdentityRedirect)) {
1071
- c.value = !1, setTimeout(() => {
1072
- window.location.href = s.bindIdentityRedirect;
1073
- }, 300);
1074
- return;
1075
- }
1076
- n("success", {
1077
- token: f,
1078
- userId: S || "",
1079
- appId: V || "",
1080
- needBindIdentity: q
1081
- });
1082
- const C = sessionStorage.getItem("auth_redirect");
1083
- sessionStorage.removeItem("auth_redirect");
1084
- const B = C || s.defaultRedirect || "/";
1085
- c.value = !1, setTimeout(() => {
1086
- window.location.href = B;
1087
- }, 500);
1088
- } catch (T) {
1089
- console.error("OAuth 回调处理失败:", T), r.value = "登录处理失败,请重试", c.value = !1, n("error", r.value);
1090
- }
1091
- }
1092
- function y() {
1093
- const g = sessionStorage.getItem("auth_redirect");
1094
- sessionStorage.removeItem("auth_redirect"), window.location.href = g || s.defaultRedirect || "/";
1095
- }
1096
- return Z(() => {
1097
- const g = new URLSearchParams(window.location.search);
1098
- if (g.has("token") || g.has("error"))
1099
- l();
1100
- else if (t()) {
1101
- const a = sessionStorage.getItem("auth_redirect");
1102
- sessionStorage.removeItem("auth_redirect"), window.location.href = a || s.defaultRedirect || "/";
1103
- } else
1104
- r.value = "无效的访问", c.value = !1;
1105
- }), (g, a) => (h(), _("div", dt, [c.value ? (h(), _("div", ct, [a[0] || (a[0] = m("div", {
1106
- class: "spinner"
1107
- }, null, -1)), m("p", null, x(d.loadingText), 1)])) : r.value ? (h(), _("div", pt, [a[1] || (a[1] = m("div", {
1108
- class: "error-icon"
1109
- }, "✕", -1)), a[2] || (a[2] = m("h2", null, "登录失败", -1)), m("p", null, x(r.value), 1), m("button", {
1110
- class: "retry-btn",
1111
- onClick: y
1112
- }, "返回重试")])) : (h(), _("div", mt, [...a[3] || (a[3] = [m("div", {
1113
- class: "success-icon"
1114
- }, "✓", -1), m("p", null, "登录成功,正在跳转...", -1)])]))]));
1115
- }
1116
- }), ii = /* @__PURE__ */ I(ft, [["__scopeId", "data-v-3a884e7b"]]), gt = {
1117
- class: "BindEmail"
1118
- }, vt = {
1119
- class: "content"
1120
- }, ht = {
1121
- class: "sendVerifyCodeItem"
1122
- }, yt = {
1123
- class: "handle"
1124
- }, _t = {
1125
- key: 0,
1126
- class: "skip"
1127
- }, wt = /* @__PURE__ */ b({
1128
- __name: "AuthkitBindEmail",
1129
- props: {
1130
- size: {
1131
- type: String,
1132
- required: !0
1133
- },
1134
- loading: {
1135
- type: Boolean,
1136
- required: !0,
1137
- default: () => !1
1138
- },
1139
- /** 是否显示跳过按钮 */
1140
- showSkip: {
1141
- type: Boolean,
1142
- default: !1
1143
- }
1144
- },
1145
- emits: ["submit", "skip"],
1146
- setup(d, {
1147
- emit: u
1148
- }) {
1149
- const s = u, n = d, c = w(), r = w(!1), o = w(), t = w({
1150
- email: void 0,
1151
- userToken: void 0,
1152
- emailVerifyId: void 0
1153
- });
1154
- async function v() {
1155
- if (!await o.value.validateField(["email"])) {
1156
- r.value = !0;
1157
- const {
1158
- data: a
1159
- } = await U.verify.email.retry.post({
1160
- email: t.value.email
1161
- });
1162
- r.value = !1, a && (t.value.emailVerifyId = a.emailVerifyId, c.value.startCountFn());
1163
- }
1164
- }
1165
- async function l() {
1166
- o.value.validate().then((g) => {
1167
- g || s("submit", {
1168
- email: t.value.email,
1169
- userToken: t.value.userToken,
1170
- emailVerifyId: t.value.emailVerifyId
1171
- });
1172
- });
1173
- }
1174
- function y() {
1175
- s("skip");
1176
- }
1177
- return (g, a) => (h(), _("div", gt, [a[4] || (a[4] = m("div", {
1178
- class: "header"
1179
- }, [m("h3", {
1180
- class: "title"
1181
- }, "绑定邮箱"), m("p", {
1182
- class: "subtitle"
1183
- }, "请绑定邮箱以完成账号设置,绑定后可使用邮箱登录")], -1)), m("div", vt, [i(e(F), {
1184
- ref_key: "formRef",
1185
- ref: o,
1186
- model: t.value,
1187
- size: n.size,
1188
- "auto-label-width": ""
1189
- }, {
1190
- default: p(() => [i(e(z), {
1191
- field: "email",
1192
- label: "邮箱",
1193
- "hide-label": "",
1194
- rules: [{
1195
- required: !0,
1196
- message: "请输入邮箱"
1197
- }, {
1198
- type: "email",
1199
- message: "请输入有效的邮箱"
1200
- }]
1201
- }, {
1202
- default: p(() => [i(e(A), {
1203
- modelValue: t.value.email,
1204
- "onUpdate:modelValue": a[0] || (a[0] = (f) => t.value.email = f),
1205
- placeholder: "请输入邮箱",
1206
- autocomplete: "email",
1207
- type: "email"
1208
- }, null, 8, ["modelValue"])]),
1209
- _: 1
1210
- }), i(e(z), {
1211
- field: "userToken",
1212
- label: "验证码",
1213
- "hide-label": "",
1214
- rules: [{
1215
- required: !0,
1216
- message: "请输入验证码"
1217
- }]
1218
- }, {
1219
- default: p(() => [m("div", ht, [i(e(A), {
1220
- modelValue: t.value.userToken,
1221
- "onUpdate:modelValue": a[1] || (a[1] = (f) => t.value.userToken = f),
1222
- placeholder: "请输入验证码",
1223
- autocomplete: "one-time-code"
1224
- }, null, 8, ["modelValue"]), i(M, {
1225
- ref_key: "SendVerifyCodeRef",
1226
- ref: c,
1227
- size: n.size,
1228
- loading: r.value,
1229
- style: {
1230
- "margin-left": "10px"
1231
- },
1232
- onSend: v
1233
- }, null, 8, ["size", "loading"])])]),
1234
- _: 1
1235
- }), m("div", yt, [i(e(O), {
1236
- type: "primary",
1237
- loading: n.loading,
1238
- long: "",
1239
- size: n.size,
1240
- onClick: l
1241
- }, {
1242
- default: p(() => [...a[2] || (a[2] = [P(" 绑定邮箱 ", -1)])]),
1243
- _: 1
1244
- }, 8, ["loading", "size"])])]),
1245
- _: 1
1246
- }, 8, ["model", "size"])]), n.showSkip ? (h(), _("div", _t, [i(e(L), {
1247
- onClick: y
1248
- }, {
1249
- default: p(() => [...a[3] || (a[3] = [P("稍后绑定", -1)])]),
1250
- _: 1
1251
- })])) : k("", !0)]));
1252
- }
1253
- }), si = /* @__PURE__ */ I(wt, [["__scopeId", "data-v-aa10f560"]]), St = {
1254
- class: "BindPhone"
1255
- }, bt = {
1256
- class: "content"
1257
- }, kt = {
1258
- class: "sendVerifyCodeItem"
1259
- }, It = {
1260
- class: "handle"
1261
- }, zt = {
1262
- key: 0,
1263
- class: "skip"
1264
- }, At = /* @__PURE__ */ b({
1265
- __name: "AuthkitBindPhone",
1266
- props: {
1267
- size: {
1268
- type: String,
1269
- required: !0
1270
- },
1271
- loading: {
1272
- type: Boolean,
1273
- required: !0,
1274
- default: () => !1
1275
- },
1276
- showSkip: {
1277
- type: Boolean,
1278
- default: !1
1279
- }
1280
- },
1281
- emits: ["submit", "skip"],
1282
- setup(d, {
1283
- emit: u
1284
- }) {
1285
- const s = u, n = d, c = w(), r = w(!1), o = w(), t = w({
1286
- phone: void 0,
1287
- code: void 0
1288
- });
1289
- async function v() {
1290
- if (!await o.value.validateField(["phone"])) {
1291
- r.value = !0;
1292
- const {
1293
- error: a
1294
- } = await U.verify.sms.send.post({
1295
- phone: t.value.phone
1296
- });
1297
- r.value = !1, a || c.value.startCountFn();
1298
- }
1299
- }
1300
- async function l() {
1301
- o.value.validate().then((g) => {
1302
- g || s("submit", {
1303
- phone: t.value.phone,
1304
- code: t.value.code
1305
- });
1306
- });
1307
- }
1308
- function y() {
1309
- s("skip");
1310
- }
1311
- return (g, a) => (h(), _("div", St, [a[4] || (a[4] = m("div", {
1312
- class: "header"
1313
- }, [m("h3", {
1314
- class: "title"
1315
- }, "绑定手机号"), m("p", {
1316
- class: "subtitle"
1317
- }, "请绑定手机号以完成账号设置")], -1)), m("div", bt, [i(e(F), {
1318
- ref_key: "formRef",
1319
- ref: o,
1320
- model: t.value,
1321
- size: n.size,
1322
- "auto-label-width": ""
1323
- }, {
1324
- default: p(() => [i(e(z), {
1325
- field: "phone",
1326
- label: "手机号",
1327
- "hide-label": "",
1328
- rules: [{
1329
- required: !0,
1330
- message: "请输入手机号"
1331
- }, {
1332
- match: /^1[3-9]\d{9}$/,
1333
- message: "请输入有效的手机号"
1334
- }]
1335
- }, {
1336
- default: p(() => [i(e(A), {
1337
- modelValue: t.value.phone,
1338
- "onUpdate:modelValue": a[0] || (a[0] = (f) => t.value.phone = f),
1339
- placeholder: "请输入手机号",
1340
- autocomplete: "tel",
1341
- type: "tel"
1342
- }, null, 8, ["modelValue"])]),
1343
- _: 1
1344
- }), i(e(z), {
1345
- field: "code",
1346
- label: "验证码",
1347
- "hide-label": "",
1348
- rules: [{
1349
- required: !0,
1350
- message: "请输入验证码"
1351
- }]
1352
- }, {
1353
- default: p(() => [m("div", kt, [i(e(A), {
1354
- modelValue: t.value.code,
1355
- "onUpdate:modelValue": a[1] || (a[1] = (f) => t.value.code = f),
1356
- placeholder: "请输入验证码",
1357
- autocomplete: "one-time-code"
1358
- }, null, 8, ["modelValue"]), i(M, {
1359
- ref_key: "SendVerifyCodeRef",
1360
- ref: c,
1361
- size: n.size,
1362
- loading: r.value,
1363
- style: {
1364
- "margin-left": "10px"
1365
- },
1366
- onSend: v
1367
- }, null, 8, ["size", "loading"])])]),
1368
- _: 1
1369
- }), m("div", It, [i(e(O), {
1370
- type: "primary",
1371
- loading: n.loading,
1372
- long: "",
1373
- size: n.size,
1374
- onClick: l
1375
- }, {
1376
- default: p(() => [...a[2] || (a[2] = [P(" 绑定手机号 ", -1)])]),
1377
- _: 1
1378
- }, 8, ["loading", "size"])])]),
1379
- _: 1
1380
- }, 8, ["model", "size"])]), n.showSkip ? (h(), _("div", zt, [i(e(L), {
1381
- onClick: y
1382
- }, {
1383
- default: p(() => [...a[3] || (a[3] = [P("稍后绑定", -1)])]),
1384
- _: 1
1385
- })])) : k("", !0)]));
1386
- }
1387
- }), oi = /* @__PURE__ */ I(At, [["__scopeId", "data-v-d6436fba"]]), Pt = {
1388
- class: "SignUpPhone"
1389
- }, Vt = {
1390
- class: "content"
1391
- }, $t = {
1392
- class: "sendVerifyCodeItem"
1393
- }, Ut = {
1394
- class: "handle"
1395
- }, Ct = /* @__PURE__ */ b({
1396
- __name: "AuthkitSignUpPhone",
1397
- props: {
1398
- size: {
1399
- type: String,
1400
- required: !0
1401
- },
1402
- loading: {
1403
- type: Boolean,
1404
- required: !0,
1405
- default: () => !1
1406
- },
1407
- /** 是否要求设置密码 */
1408
- requirePassword: {
1409
- type: Boolean,
1410
- default: !1
1411
- }
1412
- },
1413
- emits: ["switchSignIn", "submit"],
1414
- setup(d, {
1415
- emit: u
1416
- }) {
1417
- const s = u, n = d, c = w(), r = w(!1), o = w(), t = w({
1418
- phone: void 0,
1419
- code: void 0,
1420
- password: void 0,
1421
- confirmPassword: void 0,
1422
- referrerId: void 0
1423
- }), v = [{
1424
- required: !0,
1425
- message: "请输入确认密码"
1426
- }, {
1427
- validator: (a, f) => {
1428
- t.value.password && a !== t.value.password ? f("两次密码输入不一致") : f();
1429
- }
1430
- }];
1431
- function l() {
1432
- s("switchSignIn");
1433
- }
1434
- async function y() {
1435
- if (!await o.value.validateField(["phone"])) {
1436
- r.value = !0;
1437
- const {
1438
- error: f
1439
- } = await U.verify.sms.send.post({
1440
- phone: t.value.phone
1441
- });
1442
- r.value = !1, f || c.value.startCountFn();
1443
- }
1444
- }
1445
- async function g() {
1446
- o.value.validate().then((a) => {
1447
- a || s("submit", {
1448
- phone: t.value.phone,
1449
- code: t.value.code,
1450
- password: t.value.password,
1451
- referrerId: t.value.referrerId
1452
- });
1453
- });
1454
- }
1455
- return (a, f) => (h(), _("div", Pt, [m("div", Vt, [i(e(F), {
1456
- ref_key: "formRef",
1457
- ref: o,
1458
- model: t.value,
1459
- size: n.size,
1460
- "auto-label-width": ""
1461
- }, {
1462
- default: p(() => [i(e(z), {
1463
- field: "phone",
1464
- label: "手机号",
1465
- "hide-label": "",
1466
- rules: [{
1467
- required: !0,
1468
- message: "请输入手机号"
1469
- }, {
1470
- match: /^1[3-9]\d{9}$/,
1471
- message: "请输入有效的手机号"
1472
- }]
1473
- }, {
1474
- default: p(() => [i(e(A), {
1475
- modelValue: t.value.phone,
1476
- "onUpdate:modelValue": f[0] || (f[0] = (S) => t.value.phone = S),
1477
- placeholder: "请输入手机号",
1478
- autocomplete: "tel",
1479
- type: "tel"
1480
- }, null, 8, ["modelValue"])]),
1481
- _: 1
1482
- }), i(e(z), {
1483
- field: "code",
1484
- label: "验证码",
1485
- "hide-label": "",
1486
- rules: [{
1487
- required: !0,
1488
- message: "请输入验证码"
1489
- }]
1490
- }, {
1491
- default: p(() => [m("div", $t, [i(e(A), {
1492
- modelValue: t.value.code,
1493
- "onUpdate:modelValue": f[1] || (f[1] = (S) => t.value.code = S),
1494
- placeholder: "请输入验证码",
1495
- autocomplete: "one-time-code"
1496
- }, null, 8, ["modelValue"]), i(M, {
1497
- ref_key: "SendVerifyCodeRef",
1498
- ref: c,
1499
- size: n.size,
1500
- loading: r.value,
1501
- style: {
1502
- "margin-left": "10px"
1503
- },
1504
- onSend: y
1505
- }, null, 8, ["size", "loading"])])]),
1506
- _: 1
1507
- }), n.requirePassword ? (h(), $(e(z), {
1508
- key: 0,
1509
- field: "password",
1510
- label: "密码",
1511
- "hide-label": "",
1512
- rules: [{
1513
- required: n.requirePassword,
1514
- message: "密码请输入"
1515
- }, {
1516
- minLength: 10,
1517
- message: "密码不能少于10字符"
1518
- }]
1519
- }, {
1520
- default: p(() => [i(e(A), {
1521
- modelValue: t.value.password,
1522
- "onUpdate:modelValue": f[2] || (f[2] = (S) => t.value.password = S),
1523
- placeholder: "请输入密码(可选)",
1524
- type: "password",
1525
- autocomplete: "new-password"
1526
- }, null, 8, ["modelValue"])]),
1527
- _: 1
1528
- }, 8, ["rules"])) : k("", !0), n.requirePassword && t.value.password ? (h(), $(e(z), {
1529
- key: 1,
1530
- field: "confirmPassword",
1531
- label: "确认密码",
1532
- "hide-label": "",
1533
- rules: v
1534
- }, {
1535
- default: p(() => [i(e(A), {
1536
- modelValue: t.value.confirmPassword,
1537
- "onUpdate:modelValue": f[3] || (f[3] = (S) => t.value.confirmPassword = S),
1538
- placeholder: "请输入确认密码",
1539
- type: "password",
1540
- autocomplete: "new-password"
1541
- }, null, 8, ["modelValue"])]),
1542
- _: 1
1543
- })) : k("", !0), i(e(z), {
1544
- field: "referrerId",
1545
- label: "邀请人",
1546
- "hide-label": "",
1547
- rules: [{
1548
- required: !1
1549
- }]
1550
- }, {
1551
- default: p(() => [i(e(A), {
1552
- modelValue: t.value.referrerId,
1553
- "onUpdate:modelValue": f[4] || (f[4] = (S) => t.value.referrerId = S),
1554
- placeholder: "邀请人ID(可选)",
1555
- autocomplete: "off"
1556
- }, null, 8, ["modelValue"])]),
1557
- _: 1
1558
- }), m("div", Ut, [i(e(O), {
1559
- type: "primary",
1560
- loading: n.loading,
1561
- long: "",
1562
- size: n.size,
1563
- onClick: g
1564
- }, {
1565
- default: p(() => [...f[5] || (f[5] = [P(" 注册 ", -1)])]),
1566
- _: 1
1567
- }, 8, ["loading", "size"])])]),
1568
- _: 1
1569
- }, 8, ["model", "size"])]), i(X, {
1570
- onSwitchSignIn: l
1571
- })]));
1572
- }
1573
- }), ni = /* @__PURE__ */ I(Ct, [["__scopeId", "data-v-1f2f8707"]]), qt = {
1574
- class: "SignInPhone"
1575
- }, Rt = {
1576
- class: "content"
1577
- }, xt = {
1578
- class: "sendVerifyCodeItem"
1579
- }, Ot = {
1580
- class: "handle"
1581
- }, Tt = /* @__PURE__ */ b({
1582
- __name: "AuthkitSignInPhone",
1583
- props: {
1584
- size: {
1585
- type: String,
1586
- required: !0
1587
- },
1588
- loading: {
1589
- type: Boolean,
1590
- required: !0,
1591
- default: () => !1
1592
- }
1593
- },
1594
- emits: ["submit", "switchSignUp", "switchResetPassword"],
1595
- setup(d, {
1596
- emit: u
1597
- }) {
1598
- const s = u, n = d, c = Y(), r = R(() => !!c.OAuth), o = w(), t = w(!1), v = w(), l = w({
1599
- phone: void 0,
1600
- code: void 0
1601
- });
1602
- function y() {
1603
- s("switchSignUp");
1604
- }
1605
- function g() {
1606
- s("switchResetPassword");
1607
- }
1608
- async function a() {
1609
- if (!await v.value.validateField(["phone"])) {
1610
- t.value = !0;
1611
- const {
1612
- error: V
1613
- } = await U.verify.sms.send.post({
1614
- phone: l.value.phone
1615
- });
1616
- t.value = !1, V || o.value.startCountFn();
1617
- }
1618
- }
1619
- async function f() {
1620
- v.value.validate().then((S) => {
1621
- S || s("submit", {
1622
- identifier: l.value.phone,
1623
- code: l.value.code,
1624
- method: "code"
1625
- });
1626
- });
1627
- }
1628
- return (S, V) => (h(), _("div", qt, [m("div", Rt, [i(e(F), {
1629
- ref_key: "formRef",
1630
- ref: v,
1631
- model: l.value,
1632
- size: n.size,
1633
- "auto-label-width": ""
1634
- }, {
1635
- default: p(() => [i(e(z), {
1636
- field: "phone",
1637
- label: "手机号",
1638
- "hide-label": "",
1639
- rules: [{
1640
- required: !0,
1641
- message: "请输入手机号"
1642
- }, {
1643
- match: /^1[3-9]\d{9}$/,
1644
- message: "请输入有效的手机号"
1645
- }]
1646
- }, {
1647
- default: p(() => [i(e(A), {
1648
- modelValue: l.value.phone,
1649
- "onUpdate:modelValue": V[0] || (V[0] = (q) => l.value.phone = q),
1650
- placeholder: "请输入手机号",
1651
- autocomplete: "tel",
1652
- type: "tel"
1653
- }, null, 8, ["modelValue"])]),
1654
- _: 1
1655
- }), i(e(z), {
1656
- field: "code",
1657
- label: "验证码",
1658
- "hide-label": "",
1659
- rules: [{
1660
- required: !0,
1661
- message: "请输入验证码"
1662
- }]
1663
- }, {
1664
- default: p(() => [m("div", xt, [i(e(A), {
1665
- modelValue: l.value.code,
1666
- "onUpdate:modelValue": V[1] || (V[1] = (q) => l.value.code = q),
1667
- placeholder: "请输入验证码",
1668
- autocomplete: "one-time-code"
1669
- }, null, 8, ["modelValue"]), i(M, {
1670
- ref_key: "SendVerifyCodeRef",
1671
- ref: o,
1672
- size: n.size,
1673
- loading: t.value,
1674
- style: {
1675
- "margin-left": "10px"
1676
- },
1677
- onSend: a
1678
- }, null, 8, ["size", "loading"])])]),
1679
- _: 1
1680
- }), m("div", Ot, [i(e(O), {
1681
- type: "primary",
1682
- loading: n.loading,
1683
- long: "",
1684
- size: n.size,
1685
- onClick: f
1686
- }, {
1687
- default: p(() => [...V[2] || (V[2] = [P(" 登录 ", -1)])]),
1688
- _: 1
1689
- }, 8, ["loading", "size"])])]),
1690
- _: 1
1691
- }, 8, ["model", "size"])]), r.value ? D(S.$slots, "OAuth", {
1692
- key: 0
1693
- }, void 0, !0) : k("", !0), i(te, {
1694
- onSwitchSignUp: y,
1695
- onSwitchResetPassword: g
1696
- })]));
1697
- }
1698
- }), ai = /* @__PURE__ */ I(Tt, [["__scopeId", "data-v-6c74668e"]]);
1699
- export {
1700
- Ye as A,
1701
- we as O,
1702
- Le as P,
1703
- Ue as R,
1704
- xe as S,
1705
- K as _,
1706
- Zt as a,
1707
- ei as b,
1708
- ie as c,
1709
- ti as d,
1710
- si as e,
1711
- oi as f,
1712
- ii as g,
1713
- ze as h,
1714
- Ee as i,
1715
- ai as j,
1716
- We as k,
1717
- ni as l,
1718
- X as m,
1719
- te as n,
1720
- ve as u
1721
- };