@huyooo/ui 1.0.3 → 1.0.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 (188) hide show
  1. package/dist/AuthkitAppSetting-BN8-xgNq.js +2674 -0
  2. package/dist/{Contact-M6iyuyNL.js → Contact-BWuVR9ho.js} +105 -113
  3. package/dist/CustomTable-BzGfaAVH.js +276 -0
  4. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-B9BqGWm8.js +1480 -0
  5. package/dist/LandingPageDescription-BczWZHKy.js +12 -0
  6. package/dist/{LandingPageLinkGroup-DDNRivMt.js → LandingPageLinkGroup-BZJ48Yss.js} +87 -88
  7. package/dist/{LandingPageFAQ-CZJXvor9.js → LandingPageSectionHeader-3hiuw6G0.js} +44 -25
  8. package/dist/{LandingPageSectionTabs-Ce3_Rc2L.js → LandingPageSectionTabs-jRjkWlM-.js} +475 -375
  9. package/dist/LegalDocViewer-DM8FYBpf.js +2501 -0
  10. package/dist/Menu-uCexrsKP.js +199 -0
  11. package/dist/MessageHandle-mEkCsv9e.js +1173 -0
  12. package/dist/MessageList-Ce-_LNTk.js +244 -0
  13. package/dist/PaySubscriptions-CXkEjqr2.js +1326 -0
  14. package/dist/PricingPlans-CV97ck9p.js +427 -0
  15. package/dist/ReferrerReferees-DgygiIiE.js +237 -0
  16. package/dist/{Upload.vue_vue_type_script_setup_true_lang-B6NOZjK0.js → Upload.vue_vue_type_script_setup_true_lang-VGh2V4o0.js} +1 -1
  17. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-zgjpFVln.js +592 -0
  18. package/dist/WidthContainer-PeWkCK0p.js +721 -0
  19. package/dist/{apiClients-DrGX2iJy.js → apiClients-BcXOLuYu.js} +131 -98
  20. package/dist/authkit.d.ts +6 -2
  21. package/dist/authkit.js +53 -44
  22. package/dist/common/authProviderIcons.d.ts +12 -0
  23. package/dist/common/globalConfig.d.ts +5 -0
  24. package/dist/common/tableColumnWidths.d.ts +11 -0
  25. package/dist/common.js +3 -3
  26. package/dist/components/AuthProviderIcon.vue.d.ts +12 -0
  27. package/dist/components/Authkit/AppSetting/AuthkitEmailVerify.vue.d.ts +2 -2
  28. package/dist/components/Authkit/AppSetting/AuthkitOAuthBinding.vue.d.ts +2 -1
  29. package/dist/components/Authkit/AppSetting/AuthkitPasskeyBinding.vue.d.ts +14 -0
  30. package/dist/components/Authkit/AppSetting/AuthkitPasswordUpdate.vue.d.ts +11 -1
  31. package/dist/components/Authkit/AppSetting/AuthkitPersonalInformation.vue.d.ts +1 -3
  32. package/dist/components/Authkit/AppSetting/AuthkitPhoneVerify.vue.d.ts +13 -3
  33. package/dist/components/Authkit/Auth/AuthkitBindEmail.vue.d.ts +29 -2
  34. package/dist/components/Authkit/Auth/AuthkitBindPhone.vue.d.ts +2 -2
  35. package/dist/components/Authkit/Auth/AuthkitEmailUpdate.vue.d.ts +2 -2
  36. package/dist/components/Authkit/Auth/AuthkitOauthItem.vue.d.ts +37 -9
  37. package/dist/components/Authkit/Auth/AuthkitOauthList.vue.d.ts +7 -11
  38. package/dist/components/Authkit/Auth/AuthkitPasswordUpdateAndVerify.vue.d.ts +2 -2
  39. package/dist/components/Authkit/Auth/AuthkitPhonePasswordUpdateAndVerify.vue.d.ts +2 -2
  40. package/dist/components/Authkit/Auth/AuthkitServiceAgreementAndPrivacyProtection.vue.d.ts +11 -7
  41. package/dist/components/Authkit/Auth/AuthkitSignInEmailCode.vue.d.ts +2 -2
  42. package/dist/components/Authkit/Auth/AuthkitSignInPhone.vue.d.ts +3 -62
  43. package/dist/components/Authkit/Auth/AuthkitSignUpPhone.vue.d.ts +2 -2
  44. package/dist/components/Authkit/Auth/AuthkitSwitchSignUpOrResetPassword.vue.d.ts +9 -0
  45. package/dist/components/Authkit/AuthkitAuth.vue.d.ts +2 -8
  46. package/dist/components/Authkit/AuthkitAuthModal.vue.d.ts +0 -4
  47. package/dist/components/Authkit/AuthkitProvider.vue.d.ts +5 -2
  48. package/dist/components/Authkit/AuthkitSendVerifyCode.vue.d.ts +2 -1
  49. package/dist/components/CustomTable.vue.d.ts +27 -1
  50. package/dist/components/Ellipsis.vue.d.ts +2 -6
  51. package/dist/components/Feedback/FeedbackList.vue.d.ts +4 -1
  52. package/dist/components/Gradientbackground.vue.d.ts +2 -2
  53. package/dist/components/HeaderMenus.vue.d.ts +4 -1
  54. package/dist/components/InfiniteLoading.vue.d.ts +1 -1
  55. package/dist/components/LandingPage/LandingPageButton.vue.d.ts +2 -2
  56. package/dist/components/LandingPage/LandingPageContainer.vue.d.ts +2 -2
  57. package/dist/components/LandingPage/LandingPageFeaturePanels.vue.d.ts +19 -0
  58. package/dist/components/LandingPage/LandingPageHero.vue.d.ts +9 -0
  59. package/dist/components/LandingPage/LandingPagePageContent.vue.d.ts +2 -2
  60. package/dist/components/LandingPage/LandingPageSectionHeader.vue.d.ts +1 -14
  61. package/dist/components/LandingPage/LandingPageSections.vue.d.ts +1 -1
  62. package/dist/components/LegalDoc/LegalDocViewer.vue.d.ts +7 -0
  63. package/dist/components/Menu.vue.d.ts +2 -1
  64. package/dist/components/MenuItem.vue.d.ts +3 -1
  65. package/dist/components/Message/MessageAppMessage.vue.d.ts +12 -2
  66. package/dist/components/Message/MessageDetails.vue.d.ts +9 -161
  67. package/dist/components/Message/MessageHandle.vue.d.ts +16 -4
  68. package/dist/components/Message/MessageList.vue.d.ts +4 -3
  69. package/dist/components/Message/MessageNotificationDetails.vue.d.ts +13 -0
  70. package/dist/components/Message/messageBody/DescriptionsMessageBody.vue.d.ts +3 -0
  71. package/dist/components/Message/messageBody/JsonMessageBodyFallback.vue.d.ts +3 -0
  72. package/dist/components/Message/messageBody/TextMessageBody.vue.d.ts +3 -0
  73. package/dist/components/Message/messageBody/descriptionRows.d.ts +14 -0
  74. package/dist/components/Message/messageBody/descriptionsMessageBody.d.ts +32 -0
  75. package/dist/components/Message/messageBody/descriptionsValueRender.d.ts +4 -0
  76. package/dist/components/Message/messageBody/messageBodyRegistry.d.ts +9 -0
  77. package/dist/components/Message/messageBody/registerBuiltinMessageBodies.d.ts +2 -0
  78. package/dist/components/Message/messageBody/types.d.ts +7 -0
  79. package/dist/components/Referrer/ReferrerRefereeCell.vue.d.ts +7 -0
  80. package/dist/components/Referrer/ReferrerReferees.vue.d.ts +1 -0
  81. package/dist/components/UserMenu/UserAccountMenu.vue.d.ts +1 -16
  82. package/dist/components/UserMenu/UserMenuItem.vue.d.ts +4 -0
  83. package/dist/components/UserMenu/UserMenuModals.vue.d.ts +18 -4
  84. package/dist/components/UserMenu/parts/UserAvatar.vue.d.ts +6 -0
  85. package/dist/components/UserMenu/parts/UserBasicInformation.vue.d.ts +7 -2
  86. package/dist/composables/Authkit/fetchAuthPageAboutUs.d.ts +3 -0
  87. package/dist/composables/Authkit/resolveRoutePermission.d.ts +2 -0
  88. package/dist/composables/Authkit/useAuthkitAppsAuthPageInfo.d.ts +16 -0
  89. package/dist/composables/Authkit/useAuthkitAuth.d.ts +2 -0
  90. package/dist/composables/Authkit/useAuthkitPasskey.d.ts +10 -0
  91. package/dist/composables/Authkit/useLegalDocHostActions.d.ts +6 -0
  92. package/dist/composables/Authkit/useLegalDocs.d.ts +19 -0
  93. package/dist/composables/Authkit/useOauth.d.ts +17 -4
  94. package/dist/composables/Authkit/useRegistrationTerms.d.ts +24 -0
  95. package/dist/composables/Authkit/verifyCodeCooldown.d.ts +19 -0
  96. package/dist/composables/Billing/useBillingPlans.d.ts +0 -4
  97. package/dist/composables/Billing/useBillingStatusOptions.d.ts +2 -6
  98. package/dist/composables/Billing/useBillingSubscriptionSummary.d.ts +16 -0
  99. package/dist/composables/Billing/usePaidProductOptions.d.ts +5 -0
  100. package/dist/composables/Message/messageCenterBadgeCounts.d.ts +28 -0
  101. package/dist/composables/UserMenu/useUserMenuBadgeCounts.d.ts +9 -0
  102. package/dist/composables/useInfiniteList.d.ts +19 -0
  103. package/dist/composables/useMessageNotifications.d.ts +3 -6
  104. package/dist/composables.d.ts +4 -2
  105. package/dist/composables.js +50 -45
  106. package/dist/feedback.d.ts +1 -0
  107. package/dist/feedback.js +12 -11
  108. package/dist/fetchAuthPageAboutUs-dzTSwRsB.js +25 -0
  109. package/dist/{Clipboard-Bo7gdpR6.js → index-BkLvw1PU.js} +1 -1
  110. package/dist/landingPage.d.ts +1 -0
  111. package/dist/landingPage.js +41 -40
  112. package/dist/legalDocs/buildBuiltinUrl.d.ts +3 -0
  113. package/dist/{utils/legalLinks.d.ts → legalDocs/constants.d.ts} +0 -10
  114. package/dist/legalDocs/index.d.ts +7 -0
  115. package/dist/legalDocs/isConfigured.d.ts +7 -0
  116. package/dist/legalDocs/open.d.ts +3 -0
  117. package/dist/legalDocs/resolveAppId.d.ts +8 -0
  118. package/dist/legalDocs/resolveTarget.d.ts +4 -0
  119. package/dist/legalDocs/types.d.ts +12 -0
  120. package/dist/main.js +321 -308
  121. package/dist/message.d.ts +3 -0
  122. package/dist/message.js +301 -21
  123. package/dist/pay.d.ts +1 -1
  124. package/dist/pay.js +14 -17
  125. package/dist/privateCom.js +1 -1
  126. package/dist/referrer.js +1 -1
  127. package/dist/style.css +1 -1
  128. package/dist/types/api/auth.generated.d.ts +1385 -328
  129. package/dist/types/api/billing.generated.d.ts +907 -76
  130. package/dist/types/api/ones.generated.d.ts +131 -2
  131. package/dist/types/api.d.ts +1 -0
  132. package/dist/types/app.d.ts +10 -0
  133. package/dist/types/user.d.ts +1 -0
  134. package/dist/upload.js +2 -2
  135. package/dist/{useAuthkitAppsAuthPageInfo-C2yKgl8t.js → useAuthkitAppsAuthPageInfo-CNudJd04.js} +18 -17
  136. package/dist/useAuthkitAuth-3m0yW6uP.js +267 -0
  137. package/dist/{useAuthkitCreateAndUpdate-oo9517Gj.js → useAuthkitCreateAndUpdate-BsINsI-E.js} +1 -1
  138. package/dist/{useAuthkitUsersProfile-BZDk21c8.js → useAuthkitUsersProfile-DJlMsftY.js} +3 -3
  139. package/dist/useBillingStatusOptions-CfHQOFNw.js +71 -0
  140. package/dist/{useEnsureAuthenticated-BuIbxqsO.js → useEnsureAuthenticated-DNkCCy_Y.js} +2 -2
  141. package/dist/useLegalDocs-DQP_Yq6B.js +106 -0
  142. package/dist/{useMessageNotifications-D85_-mDq.js → useMessageNotifications-CAphguOm.js} +21 -24
  143. package/dist/useRoutePermission-CEiya9AM.js +218 -0
  144. package/dist/useSEO-CDWxbk8B.js +221 -0
  145. package/dist/useSubscriptionCheckout-d_M_rKRa.js +368 -0
  146. package/dist/{useUploadCos-BRKRzSy3.js → useUploadCos-C8BqFPkx.js} +1 -1
  147. package/dist/user.js +1 -1
  148. package/dist/userMenuModal-D-nDaYqM.js +66 -0
  149. package/dist/utils/apiMiddlewares.d.ts +5 -5
  150. package/dist/utils/apiResponse.d.ts +11 -0
  151. package/dist/utils/authProviderIcon.d.ts +3 -0
  152. package/dist/utils/authkit.d.ts +20 -7
  153. package/dist/utils/formatPoints.d.ts +8 -0
  154. package/dist/utils/messageNotificationContent.d.ts +4 -0
  155. package/dist/utils/messageTextLink.d.ts +9 -0
  156. package/dist/utils/passkeySupport.d.ts +8 -0
  157. package/dist/utils/pointsFlowTypes.d.ts +10 -0
  158. package/dist/utils/pointsHistoryDisplay.d.ts +8 -0
  159. package/dist/utils/refundStatusDisplay.d.ts +1 -0
  160. package/dist/utils/subscriptionDisplay.d.ts +7 -0
  161. package/dist/utils/userDisplay.d.ts +41 -0
  162. package/package.json +11 -3
  163. package/dist/AuthkitAppSetting-C-0uuLSg.js +0 -1921
  164. package/dist/AuthkitGithubBinding-C5zEy9zN.js +0 -2207
  165. package/dist/CustomTable-nsxN4Ja4.js +0 -276
  166. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-M1NQ-rx-.js +0 -1396
  167. package/dist/LandingPageSectionHeader-D_74W4My.js +0 -69
  168. package/dist/Menu-Cy2ZPeaz.js +0 -170
  169. package/dist/MessageHandle-BG12aX0i.js +0 -924
  170. package/dist/MessageList-CrCF8mU6.js +0 -233
  171. package/dist/MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-gsjL6yAe.js +0 -142
  172. package/dist/PaySubscriptions-lWnEioX5.js +0 -1241
  173. package/dist/PricingPlans-DFcjOMWS.js +0 -404
  174. package/dist/ReferrerReferees-Cn7KaO8z.js +0 -106
  175. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-P0X1Exyu.js +0 -520
  176. package/dist/WidthContainer-CF3qOLWW.js +0 -688
  177. package/dist/common/authPanelWidth.d.ts +0 -2
  178. package/dist/components/Feedback/FeedbackDetails.vue.d.ts +0 -178
  179. package/dist/composables/Authkit/useLegalLinks.d.ts +0 -34
  180. package/dist/index-D3Kp6R4z.js +0 -4
  181. package/dist/useAuthkitAuth-DmS-H7M2.js +0 -175
  182. package/dist/useBillingStatusOptions-B7xLU3fs.js +0 -145
  183. package/dist/useLegalLinks-Cwr45PBT.js +0 -60
  184. package/dist/useRoutePermission-CaWtjLRA.js +0 -212
  185. package/dist/useSEO-BSMQdBR9.js +0 -158
  186. package/dist/useSubscriptionCheckout-BRk5h9aC.js +0 -365
  187. package/dist/useTableHandle-BdujaiNX.js +0 -69
  188. /package/dist/components/{Feedback/FeedbackVideoPreview.vue.d.ts → VideoPreview.vue.d.ts} +0 -0
@@ -1,2207 +0,0 @@
1
- import { defineComponent as I, openBlock as c, createElementBlock as b, normalizeClass as me, createVNode as s, unref as t, computed as $, createElementVNode as y, createCommentVNode as z, createBlock as k, ref as S, withCtx as f, createTextVNode as C, watchEffect as ee, Fragment as N, renderList as te, toDisplayString as O, useSlots as re, renderSlot as j, onMounted as F, normalizeStyle as Q, onUnmounted as ie } from "vue";
2
- /* empty css */
3
- /* empty css */
4
- import "./index-D3Kp6R4z.js";
5
- import { Form as x, FormItem as A, Input as V, Button as B, Link as M, Tabs as oe, TabPane as se, Divider as ae, Modal as fe, Message as Z, List as ve, ListItem as X, ListItemMeta as Y, Avatar as G, Alert as le } from "@arco-design/web-vue";
6
- import { u as H } from "./useAuthkitAuth-DmS-H7M2.js";
7
- import { e as T, u as ge, s as he, g as ye } from "./apiClients-DrGX2iJy.js";
8
- import { u as E } from "./useAuthkitAppsAuthPageInfo-C2yKgl8t.js";
9
- import { u as ue, S as D, r as we, a as _e, b as be } from "./AuthkitAppSetting-C-0uuLSg.js";
10
- import { Icon as de } from "@iconify/vue";
11
- import { _ as P } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
- /* empty css */
13
- /* empty css */
14
- /* empty css */
15
- import { u as Se } from "./useLegalLinks-Cwr45PBT.js";
16
- import { u as J } from "./useAuthkitUsersProfile-BZDk21c8.js";
17
- /* empty css */
18
- /* empty css */
19
- /* empty css */
20
- const ke = 440, ze = ["title", "aria-label"], Ie = /* @__PURE__ */ I({
21
- __name: "AuthkitOauthItem",
22
- props: {
23
- size: {
24
- type: String,
25
- required: !0
26
- },
27
- icon: {
28
- type: String,
29
- required: !0,
30
- default: () => ""
31
- },
32
- label: {
33
- type: String,
34
- required: !0,
35
- default: () => ""
36
- }
37
- },
38
- setup(g) {
39
- const u = g;
40
- return (n, o) => (c(), b("button", {
41
- class: me(["OAuthItem", {
42
- "OAuthItem--wechat": u.label === "微信"
43
- }]),
44
- type: "button",
45
- title: u.label,
46
- "aria-label": u.label
47
- }, [s(t(de), {
48
- icon: u.icon
49
- }, null, 8, ["icon"])], 10, ze));
50
- }
51
- }), W = /* @__PURE__ */ P(Ie, [["__scopeId", "data-v-61ace547"]]), Pe = {
52
- class: "OAuthList"
53
- }, Ae = {
54
- key: 0,
55
- class: "OAuthDivider"
56
- }, Ve = {
57
- class: "OAuthIcons"
58
- }, Ue = /* @__PURE__ */ I({
59
- __name: "AuthkitOauthList",
60
- props: {
61
- size: {
62
- type: String,
63
- default: () => "large"
64
- },
65
- appId: {
66
- type: String,
67
- default: () => ""
68
- }
69
- },
70
- setup(g) {
71
- const {
72
- appsData: u
73
- } = E(), n = g, {
74
- githubAuth: o,
75
- googleAuth: v,
76
- microsoftAuth: l,
77
- wechatAuth: r
78
- } = ue(), e = $(() => !(!u.value.oauth.google.enabled && !u.value.oauth.microsoft.enabled && !u.value.oauth.github.enabled && !u.value.oauth.wechat.enabled));
79
- return (h, i) => (c(), b("div", Pe, [e.value ? (c(), b("div", Ae, [...i[4] || (i[4] = [y("span", null, "其他登录方式", -1)])])) : z("", !0), y("div", Ve, [t(u).oauth.google.enabled ? (c(), k(W, {
80
- key: 0,
81
- icon: "logos:google-icon",
82
- label: "Google",
83
- size: n.size,
84
- onClick: i[0] || (i[0] = (p) => t(v)())
85
- }, null, 8, ["size"])) : z("", !0), t(u).oauth.github.enabled ? (c(), k(W, {
86
- key: 1,
87
- icon: "logos:github-icon",
88
- label: "Github",
89
- size: n.size,
90
- onClick: i[1] || (i[1] = (p) => t(o)())
91
- }, null, 8, ["size"])) : z("", !0), t(u).oauth.microsoft.enabled ? (c(), k(W, {
92
- key: 2,
93
- icon: "logos:microsoft-icon",
94
- label: "Microsoft",
95
- size: n.size,
96
- onClick: i[2] || (i[2] = (p) => t(l)())
97
- }, null, 8, ["size"])) : z("", !0), t(u).oauth.wechat.enabled ? (c(), k(W, {
98
- key: 3,
99
- icon: "ri:wechat-fill",
100
- label: "微信",
101
- size: n.size,
102
- onClick: i[3] || (i[3] = (p) => t(r)())
103
- }, null, 8, ["size"])) : z("", !0)])]));
104
- }
105
- }), Ce = /* @__PURE__ */ P(Ue, [["__scopeId", "data-v-4ff27a11"]]), $e = {
106
- class: "content"
107
- }, Re = {
108
- class: "sendVerifyCodeItem"
109
- }, qe = {
110
- class: "handle"
111
- }, Be = /* @__PURE__ */ I({
112
- __name: "AuthkitPasswordUpdateAndVerify",
113
- props: {
114
- size: {
115
- type: String,
116
- required: !0
117
- },
118
- loading: {
119
- type: Boolean,
120
- required: !0,
121
- default: () => !0
122
- }
123
- },
124
- emits: ["signIn", "submit"],
125
- setup(g, {
126
- emit: u
127
- }) {
128
- const n = u, o = g, v = S(), l = S(!1), r = S(), e = S({
129
- email: void 0,
130
- userToken: void 0,
131
- emailVerifyId: void 0,
132
- password: void 0,
133
- confirmPassword: void 0
134
- });
135
- async function h() {
136
- if (!await r.value.validateField(["email"])) {
137
- l.value = !0;
138
- const {
139
- data: m
140
- } = await T.verify.email.retry.post({
141
- email: e.value.email,
142
- purpose: "resetPassword"
143
- });
144
- l.value = !1, m && (e.value.emailVerifyId = m.emailVerifyId, v.value.startCountFn());
145
- }
146
- }
147
- async function i() {
148
- r.value.validate().then((p) => {
149
- p || n("submit", e.value);
150
- });
151
- }
152
- return (p, m) => (c(), b("div", $e, [s(t(x), {
153
- ref_key: "formRef",
154
- ref: r,
155
- model: e.value,
156
- size: o.size,
157
- "auto-label-width": ""
158
- }, {
159
- default: f(() => [s(t(A), {
160
- field: "email",
161
- label: "邮箱",
162
- "hide-label": "",
163
- rules: [{
164
- required: !0,
165
- message: "请输入邮箱"
166
- }, {
167
- type: "email",
168
- message: "请输入有效的邮箱"
169
- }]
170
- }, {
171
- default: f(() => [s(t(V), {
172
- modelValue: e.value.email,
173
- "onUpdate:modelValue": m[0] || (m[0] = (a) => e.value.email = a),
174
- placeholder: "请输入邮箱"
175
- }, null, 8, ["modelValue"])]),
176
- _: 1
177
- }), s(t(A), {
178
- field: "userToken",
179
- label: "验证码",
180
- "hide-label": "",
181
- rules: [{
182
- required: !0,
183
- message: "请输入验证码"
184
- }]
185
- }, {
186
- default: f(() => [y("div", Re, [s(t(V), {
187
- modelValue: e.value.userToken,
188
- "onUpdate:modelValue": m[1] || (m[1] = (a) => e.value.userToken = a),
189
- placeholder: "请输入验证码"
190
- }, null, 8, ["modelValue"]), s(D, {
191
- ref_key: "SendVerifyCodeRef",
192
- ref: v,
193
- size: o.size,
194
- loading: l.value,
195
- style: {
196
- "margin-left": "10px"
197
- },
198
- onSend: h
199
- }, null, 8, ["size", "loading"])])]),
200
- _: 1
201
- }), s(t(A), {
202
- field: "password",
203
- label: "密码",
204
- "hide-label": "",
205
- rules: [{
206
- required: !0,
207
- message: "密码请输入"
208
- }, {
209
- minLength: 10,
210
- message: "密码不能少于10字符"
211
- }]
212
- }, {
213
- default: f(() => [s(t(V), {
214
- modelValue: e.value.password,
215
- "onUpdate:modelValue": m[2] || (m[2] = (a) => e.value.password = a),
216
- placeholder: "请输入密码",
217
- type: "password",
218
- autocomplete: ""
219
- }, null, 8, ["modelValue"])]),
220
- _: 1
221
- }), s(t(A), {
222
- field: "confirmPassword",
223
- label: "确认密码",
224
- "hide-label": "",
225
- rules: [{
226
- required: !0,
227
- message: "请输入确认密码"
228
- }, {
229
- minLength: 10,
230
- message: "确认密码不能少于10字符"
231
- }, {
232
- validator: (a, d) => {
233
- a !== e.value.password ? d("两次密码输入不一致,请重新输入") : d();
234
- }
235
- }]
236
- }, {
237
- default: f(() => [s(t(V), {
238
- modelValue: e.value.confirmPassword,
239
- "onUpdate:modelValue": m[3] || (m[3] = (a) => e.value.confirmPassword = a),
240
- placeholder: "请输入确认密码密码",
241
- type: "password",
242
- autocomplete: ""
243
- }, null, 8, ["modelValue"])]),
244
- _: 1
245
- }, 8, ["rules"]), y("div", qe, [s(t(B), {
246
- type: "primary",
247
- loading: o.loading,
248
- long: "",
249
- size: o.size,
250
- onClick: i
251
- }, {
252
- default: f(() => [...m[4] || (m[4] = [C(" 提交 ", -1)])]),
253
- _: 1
254
- }, 8, ["loading", "size"])])]),
255
- _: 1
256
- }, 8, ["model", "size"])]));
257
- }
258
- }), Te = /* @__PURE__ */ P(Be, [["__scopeId", "data-v-6748c8cb"]]), Oe = {
259
- class: "content"
260
- }, xe = {
261
- class: "sendVerifyCodeItem"
262
- }, Le = /* @__PURE__ */ I({
263
- __name: "AuthkitPhonePasswordUpdateAndVerify",
264
- props: {
265
- size: {
266
- type: String,
267
- required: !0
268
- },
269
- loading: {
270
- type: Boolean,
271
- required: !0,
272
- default: () => !0
273
- }
274
- },
275
- emits: ["submit"],
276
- setup(g, {
277
- emit: u
278
- }) {
279
- const n = u, o = g, v = S(), l = S(!1), r = S(), e = S({
280
- phone: void 0,
281
- code: void 0,
282
- password: void 0,
283
- confirmPassword: void 0
284
- }), h = [{
285
- required: !0,
286
- message: "请输入确认密码"
287
- }, {
288
- minLength: 10,
289
- message: "确认密码不能少于10字符"
290
- }, {
291
- validator: (m, a) => {
292
- if (m !== e.value.password) {
293
- a("两次密码输入不一致,请重新输入");
294
- return;
295
- }
296
- a();
297
- }
298
- }];
299
- async function i() {
300
- if (!await r.value.validateField(["phone"])) {
301
- l.value = !0;
302
- const {
303
- error: a
304
- } = await T.verify.sms.send.post({
305
- phone: e.value.phone,
306
- purpose: "resetPassword"
307
- });
308
- l.value = !1, a || v.value.startCountFn();
309
- }
310
- }
311
- async function p() {
312
- r.value.validate().then((m) => {
313
- m || n("submit", {
314
- method: "phone",
315
- phone: e.value.phone,
316
- code: e.value.code,
317
- password: e.value.password
318
- });
319
- });
320
- }
321
- return (m, a) => (c(), b("div", Oe, [s(t(x), {
322
- ref_key: "formRef",
323
- ref: r,
324
- model: e.value,
325
- size: o.size,
326
- "auto-label-width": ""
327
- }, {
328
- default: f(() => [s(t(A), {
329
- field: "phone",
330
- label: "手机号",
331
- "hide-label": "",
332
- rules: [{
333
- required: !0,
334
- message: "请输入手机号"
335
- }, {
336
- match: /^1[3-9]\d{9}$/,
337
- message: "请输入有效的手机号"
338
- }]
339
- }, {
340
- default: f(() => [s(t(V), {
341
- modelValue: e.value.phone,
342
- "onUpdate:modelValue": a[0] || (a[0] = (d) => e.value.phone = d),
343
- placeholder: "请输入手机号",
344
- autocomplete: "tel",
345
- type: "tel"
346
- }, null, 8, ["modelValue"])]),
347
- _: 1
348
- }), s(t(A), {
349
- field: "code",
350
- label: "验证码",
351
- "hide-label": "",
352
- rules: [{
353
- required: !0,
354
- message: "请输入验证码"
355
- }]
356
- }, {
357
- default: f(() => [y("div", xe, [s(t(V), {
358
- modelValue: e.value.code,
359
- "onUpdate:modelValue": a[1] || (a[1] = (d) => e.value.code = d),
360
- placeholder: "请输入验证码",
361
- autocomplete: "one-time-code"
362
- }, null, 8, ["modelValue"]), s(D, {
363
- ref_key: "SendVerifyCodeRef",
364
- ref: v,
365
- size: o.size,
366
- loading: l.value,
367
- style: {
368
- "margin-left": "10px"
369
- },
370
- onSend: i
371
- }, null, 8, ["size", "loading"])])]),
372
- _: 1
373
- }), s(t(A), {
374
- field: "password",
375
- label: "密码",
376
- "hide-label": "",
377
- rules: [{
378
- required: !0,
379
- message: "密码请输入"
380
- }, {
381
- minLength: 10,
382
- message: "密码不能少于10字符"
383
- }]
384
- }, {
385
- default: f(() => [s(t(V), {
386
- modelValue: e.value.password,
387
- "onUpdate:modelValue": a[2] || (a[2] = (d) => e.value.password = d),
388
- placeholder: "请输入密码",
389
- type: "password",
390
- autocomplete: "new-password"
391
- }, null, 8, ["modelValue"])]),
392
- _: 1
393
- }), s(t(A), {
394
- field: "confirmPassword",
395
- label: "确认密码",
396
- "hide-label": "",
397
- rules: h
398
- }, {
399
- default: f(() => [s(t(V), {
400
- modelValue: e.value.confirmPassword,
401
- "onUpdate:modelValue": a[3] || (a[3] = (d) => e.value.confirmPassword = d),
402
- placeholder: "请输入确认密码",
403
- type: "password",
404
- autocomplete: "new-password"
405
- }, null, 8, ["modelValue"])]),
406
- _: 1
407
- }), s(t(B), {
408
- type: "primary",
409
- loading: o.loading,
410
- long: "",
411
- size: o.size,
412
- onClick: p
413
- }, {
414
- default: f(() => [...a[4] || (a[4] = [C(" 提交 ", -1)])]),
415
- _: 1
416
- }, 8, ["loading", "size"])]),
417
- _: 1
418
- }, 8, ["model", "size"])]));
419
- }
420
- }), Me = /* @__PURE__ */ P(Le, [["__scopeId", "data-v-717c5c0f"]]), Fe = {
421
- class: "SwitchSignIn"
422
- }, He = /* @__PURE__ */ I({
423
- __name: "AuthkitSwitchSignIn",
424
- emits: ["switchSignIn"],
425
- setup(g, {
426
- emit: u
427
- }) {
428
- const n = u;
429
- function o() {
430
- n("switchSignIn");
431
- }
432
- return (v, l) => (c(), b("div", Fe, [y("span", null, [l[1] || (l[1] = y("span", null, "已经有账号?", -1)), s(t(M), {
433
- style: {
434
- padding: "0px"
435
- },
436
- onClick: o
437
- }, {
438
- default: f(() => [...l[0] || (l[0] = [C("去登陆", -1)])]),
439
- _: 1
440
- })])]));
441
- }
442
- }), ne = /* @__PURE__ */ P(He, [["__scopeId", "data-v-fc1d3903"]]), Ee = {
443
- class: "ResetPassword"
444
- }, De = {
445
- key: 0,
446
- class: "tabsContainer"
447
- }, Ge = {
448
- key: 3,
449
- class: "empty"
450
- }, Ne = /* @__PURE__ */ I({
451
- __name: "AuthkitResetPassword",
452
- props: {
453
- size: {
454
- type: String,
455
- required: !0,
456
- default: () => "large"
457
- },
458
- loading: {
459
- type: Boolean,
460
- required: !0,
461
- default: () => !0
462
- }
463
- },
464
- emits: ["switchSignIn", "submit"],
465
- setup(g, {
466
- emit: u
467
- }) {
468
- const n = u, o = g, {
469
- appsData: v
470
- } = E(), l = $(() => v.value.authMethods), r = $(() => {
471
- const p = [];
472
- return l.value.login.emailPassword && p.push({
473
- key: "email",
474
- title: "邮箱找回"
475
- }), l.value.login.phonePassword && p.push({
476
- key: "phone",
477
- title: "手机号找回"
478
- }), p;
479
- }), e = S("email");
480
- ee(() => {
481
- var p;
482
- r.value.some((m) => m.key === e.value) || (e.value = ((p = r.value[0]) == null ? void 0 : p.key) || "email");
483
- });
484
- function h() {
485
- n("switchSignIn");
486
- }
487
- async function i(p) {
488
- n("submit", {
489
- method: e.value,
490
- ...p
491
- });
492
- }
493
- return (p, m) => (c(), b("div", Ee, [r.value.length > 1 ? (c(), b("div", De, [s(t(oe), {
494
- "active-key": e.value,
495
- "onUpdate:activeKey": m[0] || (m[0] = (a) => e.value = a)
496
- }, {
497
- default: f(() => [(c(!0), b(N, null, te(r.value, (a) => (c(), k(t(se), {
498
- key: a.key,
499
- title: a.title
500
- }, null, 8, ["title"]))), 128))]),
501
- _: 1
502
- }, 8, ["active-key"]), s(t(ae), {
503
- class: "tabsDivider",
504
- style: {
505
- margin: "0"
506
- }
507
- })])) : z("", !0), e.value === "email" && l.value.login.emailPassword ? (c(), k(Te, {
508
- key: 1,
509
- loading: g.loading,
510
- size: o.size,
511
- onSubmit: i
512
- }, null, 8, ["loading", "size"])) : e.value === "phone" && l.value.login.phonePassword ? (c(), k(Me, {
513
- key: 2,
514
- loading: g.loading,
515
- size: o.size,
516
- onSubmit: i
517
- }, null, 8, ["loading", "size"])) : (c(), b("div", Ge, "当前应用未开放找回密码")), s(ne, {
518
- onSwitchSignIn: h
519
- })]));
520
- }
521
- }), je = /* @__PURE__ */ P(Ne, [["__scopeId", "data-v-ca18289f"]]), Ke = {
522
- key: 0,
523
- class: "ServiceAgreementAndPrivacyProtection"
524
- }, We = {
525
- key: 1
526
- }, Qe = /* @__PURE__ */ I({
527
- __name: "AuthkitServiceAgreementAndPrivacyProtection",
528
- emits: ["toUserServiceAgreement", "toPrivacyPolicy"],
529
- setup(g, {
530
- emit: u
531
- }) {
532
- const n = u, {
533
- getLink: o
534
- } = Se(), v = $(() => {
535
- const i = o("userServiceAgreement");
536
- return i != null && i.configured ? i : void 0;
537
- }), l = $(() => {
538
- const i = o("privacyPolicy");
539
- return i != null && i.configured ? i : void 0;
540
- }), r = $(() => !!(v.value || l.value));
541
- function e() {
542
- n("toUserServiceAgreement");
543
- }
544
- function h() {
545
- n("toPrivacyPolicy");
546
- }
547
- return (i, p) => r.value ? (c(), b("div", Ke, [p[0] || (p[0] = y("span", null, "注册登陆即表示同意", -1)), v.value ? (c(), k(t(M), {
548
- key: 0,
549
- onClick: e
550
- }, {
551
- default: f(() => [C(O(v.value.label), 1)]),
552
- _: 1
553
- })) : z("", !0), v.value && l.value ? (c(), b("span", We, "和")) : z("", !0), l.value ? (c(), k(t(M), {
554
- key: 2,
555
- onClick: h
556
- }, {
557
- default: f(() => [C(O(l.value.label), 1)]),
558
- _: 1
559
- })) : z("", !0)])) : z("", !0);
560
- }
561
- }), Je = /* @__PURE__ */ P(Qe, [["__scopeId", "data-v-c45a9ad9"]]), Xe = {
562
- class: "content"
563
- }, Ye = {
564
- class: "handle"
565
- }, Ze = /* @__PURE__ */ I({
566
- __name: "AuthkitPasswordAuth",
567
- props: {
568
- size: {
569
- type: String,
570
- required: !0
571
- },
572
- loading: {
573
- type: Boolean,
574
- required: !0,
575
- default: () => !0
576
- },
577
- allowPhone: {
578
- type: Boolean,
579
- default: !1
580
- }
581
- },
582
- emits: ["submit"],
583
- setup(g, {
584
- emit: u
585
- }) {
586
- const n = u, o = g, v = S(), l = S({
587
- identifier: void 0,
588
- password: void 0
589
- });
590
- async function r() {
591
- v.value.validate().then((e) => {
592
- e || n("submit", l.value);
593
- });
594
- }
595
- return (e, h) => (c(), b("div", Xe, [s(t(x), {
596
- ref_key: "formRef",
597
- ref: v,
598
- model: l.value,
599
- size: o.size,
600
- "auto-label-width": ""
601
- }, {
602
- default: f(() => [s(t(A), {
603
- field: "identifier",
604
- label: "邮箱或手机号",
605
- "hide-label": "",
606
- rules: [{
607
- required: !0,
608
- message: "请输入邮箱或手机号"
609
- }]
610
- }, {
611
- default: f(() => [s(t(V), {
612
- modelValue: l.value.identifier,
613
- "onUpdate:modelValue": h[0] || (h[0] = (i) => l.value.identifier = i),
614
- placeholder: o.allowPhone ? "请输入邮箱或手机号" : "请输入邮箱",
615
- autocomplete: "email username"
616
- }, null, 8, ["modelValue", "placeholder"])]),
617
- _: 1
618
- }), s(t(A), {
619
- field: "password",
620
- label: "密码",
621
- "hide-label": "",
622
- rules: [{
623
- required: !0,
624
- message: "请输入密码"
625
- }]
626
- }, {
627
- default: f(() => [s(t(V), {
628
- modelValue: l.value.password,
629
- "onUpdate:modelValue": h[1] || (h[1] = (i) => l.value.password = i),
630
- placeholder: "请输入密码",
631
- type: "password",
632
- autocomplete: "current-password"
633
- }, null, 8, ["modelValue"])]),
634
- _: 1
635
- }), y("div", Ye, [s(t(B), {
636
- type: "primary",
637
- loading: o.loading,
638
- long: "",
639
- size: o.size,
640
- onClick: r
641
- }, {
642
- default: f(() => [...h[2] || (h[2] = [C(" 登陆 ", -1)])]),
643
- _: 1
644
- }, 8, ["loading", "size"])])]),
645
- _: 1
646
- }, 8, ["model", "size"])]));
647
- }
648
- }), et = /* @__PURE__ */ P(Ze, [["__scopeId", "data-v-f2994068"]]), tt = {
649
- class: "SwitchSignUpOrResetPassword"
650
- }, it = {
651
- key: 0
652
- }, ot = /* @__PURE__ */ I({
653
- __name: "AuthkitSwitchSignUpOrResetPassword",
654
- props: {
655
- showSignUp: {
656
- type: Boolean,
657
- default: !0
658
- }
659
- },
660
- emits: ["switchSignUp", "switchResetPassword"],
661
- setup(g, {
662
- emit: u
663
- }) {
664
- const n = g, o = u;
665
- function v() {
666
- o("switchSignUp");
667
- }
668
- function l() {
669
- o("switchResetPassword");
670
- }
671
- return (r, e) => (c(), b("div", tt, [n.showSignUp ? (c(), b("span", it, [e[1] || (e[1] = y("span", null, " 还没有账户?", -1)), s(t(M), {
672
- style: {
673
- padding: "0px"
674
- },
675
- onClick: v
676
- }, {
677
- default: f(() => [...e[0] || (e[0] = [C("去注册?", -1)])]),
678
- _: 1
679
- })])) : z("", !0), s(t(M), {
680
- style: {
681
- padding: "0px"
682
- },
683
- onClick: l
684
- }, {
685
- default: f(() => [...e[2] || (e[2] = [C(" 忘记密码?", -1)])]),
686
- _: 1
687
- })]));
688
- }
689
- }), ce = /* @__PURE__ */ P(ot, [["__scopeId", "data-v-9d5ae890"]]), st = {
690
- class: "SignInPhone"
691
- }, at = {
692
- class: "content"
693
- }, nt = {
694
- class: "sendVerifyCodeItem"
695
- }, lt = {
696
- class: "handle"
697
- }, rt = /* @__PURE__ */ I({
698
- __name: "AuthkitSignInPhone",
699
- props: {
700
- size: {
701
- type: String,
702
- required: !0
703
- },
704
- loading: {
705
- type: Boolean,
706
- required: !0,
707
- default: () => !1
708
- }
709
- },
710
- emits: ["submit", "switchSignUp", "switchResetPassword"],
711
- setup(g, {
712
- emit: u
713
- }) {
714
- const n = u, o = g, v = re(), l = $(() => !!v.OAuth), r = S(), e = S(!1), h = S(), i = S({
715
- phone: void 0,
716
- code: void 0
717
- });
718
- function p() {
719
- n("switchSignUp");
720
- }
721
- function m() {
722
- n("switchResetPassword");
723
- }
724
- async function a() {
725
- if (!await h.value.validateField(["phone"])) {
726
- e.value = !0;
727
- const {
728
- error: _
729
- } = await T.verify.sms.send.post({
730
- phone: i.value.phone,
731
- purpose: "signIn"
732
- });
733
- e.value = !1, _ || r.value.startCountFn();
734
- }
735
- }
736
- async function d() {
737
- h.value.validate().then((w) => {
738
- w || n("submit", {
739
- identifier: i.value.phone,
740
- code: i.value.code,
741
- method: "code"
742
- });
743
- });
744
- }
745
- return (w, _) => (c(), b("div", st, [y("div", at, [s(t(x), {
746
- ref_key: "formRef",
747
- ref: h,
748
- model: i.value,
749
- size: o.size,
750
- "auto-label-width": ""
751
- }, {
752
- default: f(() => [s(t(A), {
753
- field: "phone",
754
- label: "手机号",
755
- "hide-label": "",
756
- rules: [{
757
- required: !0,
758
- message: "请输入手机号"
759
- }, {
760
- match: /^1[3-9]\d{9}$/,
761
- message: "请输入有效的手机号"
762
- }]
763
- }, {
764
- default: f(() => [s(t(V), {
765
- modelValue: i.value.phone,
766
- "onUpdate:modelValue": _[0] || (_[0] = (U) => i.value.phone = U),
767
- placeholder: "请输入手机号",
768
- autocomplete: "tel",
769
- type: "tel"
770
- }, null, 8, ["modelValue"])]),
771
- _: 1
772
- }), s(t(A), {
773
- field: "code",
774
- label: "验证码",
775
- "hide-label": "",
776
- rules: [{
777
- required: !0,
778
- message: "请输入验证码"
779
- }]
780
- }, {
781
- default: f(() => [y("div", nt, [s(t(V), {
782
- modelValue: i.value.code,
783
- "onUpdate:modelValue": _[1] || (_[1] = (U) => i.value.code = U),
784
- placeholder: "请输入验证码",
785
- autocomplete: "one-time-code"
786
- }, null, 8, ["modelValue"]), s(D, {
787
- ref_key: "SendVerifyCodeRef",
788
- ref: r,
789
- size: o.size,
790
- loading: e.value,
791
- style: {
792
- "margin-left": "10px"
793
- },
794
- onSend: a
795
- }, null, 8, ["size", "loading"])])]),
796
- _: 1
797
- }), y("div", lt, [s(t(B), {
798
- type: "primary",
799
- loading: o.loading,
800
- long: "",
801
- size: o.size,
802
- onClick: d
803
- }, {
804
- default: f(() => [..._[2] || (_[2] = [C(" 登录 ", -1)])]),
805
- _: 1
806
- }, 8, ["loading", "size"])])]),
807
- _: 1
808
- }, 8, ["model", "size"])]), l.value ? j(w.$slots, "OAuth", {
809
- key: 0
810
- }, void 0, !0) : z("", !0), s(ce, {
811
- onSwitchSignUp: p,
812
- onSwitchResetPassword: m
813
- })]));
814
- }
815
- }), ut = /* @__PURE__ */ P(rt, [["__scopeId", "data-v-723d4155"]]), dt = {
816
- class: "SignInEmailCode"
817
- }, ct = {
818
- class: "sendVerifyCodeItem"
819
- }, pt = /* @__PURE__ */ I({
820
- __name: "AuthkitSignInEmailCode",
821
- props: {
822
- size: {
823
- type: String,
824
- required: !0
825
- },
826
- loading: {
827
- type: Boolean,
828
- required: !0,
829
- default: () => !1
830
- }
831
- },
832
- emits: ["submit"],
833
- setup(g, {
834
- emit: u
835
- }) {
836
- const n = u, o = g, v = S(), l = S(!1), r = S(), e = S({
837
- email: void 0,
838
- code: void 0,
839
- emailVerifyId: ""
840
- });
841
- async function h() {
842
- if (!await r.value.validateField(["email"])) {
843
- l.value = !0;
844
- const {
845
- data: m,
846
- error: a
847
- } = await T.verify.email.retry.post({
848
- email: e.value.email,
849
- purpose: "signIn"
850
- });
851
- l.value = !1, !a && (m != null && m.emailVerifyId) && (e.value.emailVerifyId = m.emailVerifyId, v.value.startCountFn());
852
- }
853
- }
854
- async function i() {
855
- r.value.validate().then((p) => {
856
- p || n("submit", {
857
- identifier: e.value.email,
858
- code: e.value.code,
859
- emailVerifyId: e.value.emailVerifyId,
860
- method: "code"
861
- });
862
- });
863
- }
864
- return (p, m) => (c(), b("div", dt, [s(t(x), {
865
- ref_key: "formRef",
866
- ref: r,
867
- model: e.value,
868
- size: o.size,
869
- "auto-label-width": ""
870
- }, {
871
- default: f(() => [s(t(A), {
872
- field: "email",
873
- "hide-label": "",
874
- rules: [{
875
- required: !0,
876
- message: "请输入邮箱"
877
- }, {
878
- type: "email",
879
- message: "请输入有效的邮箱"
880
- }]
881
- }, {
882
- default: f(() => [s(t(V), {
883
- modelValue: e.value.email,
884
- "onUpdate:modelValue": m[0] || (m[0] = (a) => e.value.email = a),
885
- placeholder: "请输入邮箱",
886
- autocomplete: "email"
887
- }, null, 8, ["modelValue"])]),
888
- _: 1
889
- }), s(t(A), {
890
- field: "code",
891
- "hide-label": "",
892
- rules: [{
893
- required: !0,
894
- message: "请输入验证码"
895
- }]
896
- }, {
897
- default: f(() => [y("div", ct, [s(t(V), {
898
- modelValue: e.value.code,
899
- "onUpdate:modelValue": m[1] || (m[1] = (a) => e.value.code = a),
900
- placeholder: "请输入验证码",
901
- autocomplete: "one-time-code"
902
- }, null, 8, ["modelValue"]), s(D, {
903
- ref_key: "SendVerifyCodeRef",
904
- ref: v,
905
- size: o.size,
906
- loading: l.value,
907
- style: {
908
- "margin-left": "10px"
909
- },
910
- onSend: h
911
- }, null, 8, ["size", "loading"])])]),
912
- _: 1
913
- }), s(t(B), {
914
- type: "primary",
915
- loading: o.loading,
916
- long: "",
917
- size: o.size,
918
- onClick: i
919
- }, {
920
- default: f(() => [...m[2] || (m[2] = [C(" 登录 ", -1)])]),
921
- _: 1
922
- }, 8, ["loading", "size"])]),
923
- _: 1
924
- }, 8, ["model", "size"])]));
925
- }
926
- }), mt = /* @__PURE__ */ P(pt, [["__scopeId", "data-v-7d6e80be"]]), ft = {
927
- class: "SignIn"
928
- }, vt = {
929
- key: 0,
930
- class: "tabsContainer"
931
- }, gt = /* @__PURE__ */ I({
932
- __name: "AuthkitSignIn",
933
- props: {
934
- size: {
935
- type: String,
936
- required: !0
937
- },
938
- loading: {
939
- type: Boolean,
940
- required: !0,
941
- default: () => !0
942
- }
943
- },
944
- emits: ["submit", "switchSignUp", "switchResetPassword"],
945
- setup(g, {
946
- emit: u
947
- }) {
948
- const n = u, o = g, v = re(), l = $(() => !!v.OAuth), {
949
- appsData: r
950
- } = E(), e = $(() => r.value.authMethods), h = $(() => {
951
- const d = [];
952
- return (e.value.login.emailPassword || e.value.login.phonePassword) && d.push({
953
- key: "password",
954
- title: e.value.login.phonePassword ? "邮箱/手机号密码登录" : "邮箱密码登录"
955
- }), e.value.login.phoneCode && d.push({
956
- key: "phoneCode",
957
- title: "手机验证码登录"
958
- }), e.value.login.emailCode && d.push({
959
- key: "emailCode",
960
- title: "邮箱验证码登录"
961
- }), d;
962
- }), i = S("password");
963
- ee(() => {
964
- var d;
965
- h.value.some((w) => w.key === i.value) || (i.value = ((d = h.value[0]) == null ? void 0 : d.key) || "password");
966
- });
967
- function p() {
968
- n("switchSignUp");
969
- }
970
- function m() {
971
- n("switchResetPassword");
972
- }
973
- async function a(d) {
974
- n("submit", {
975
- method: i.value === "password" ? "password" : "code",
976
- ...d
977
- });
978
- }
979
- return (d, w) => (c(), b("div", ft, [h.value.length > 1 ? (c(), b("div", vt, [s(t(oe), {
980
- "active-key": i.value,
981
- "onUpdate:activeKey": w[0] || (w[0] = (_) => i.value = _)
982
- }, {
983
- default: f(() => [(c(!0), b(N, null, te(h.value, (_) => (c(), k(t(se), {
984
- key: _.key,
985
- title: _.title
986
- }, null, 8, ["title"]))), 128))]),
987
- _: 1
988
- }, 8, ["active-key"]), s(t(ae), {
989
- class: "tabsDivider",
990
- style: {
991
- margin: "0"
992
- }
993
- })])) : z("", !0), i.value === "password" && (e.value.login.emailPassword || e.value.login.phonePassword) ? (c(), k(et, {
994
- key: 1,
995
- loading: o.loading,
996
- size: o.size,
997
- "allow-phone": e.value.login.phonePassword,
998
- onSubmit: a
999
- }, null, 8, ["loading", "size", "allow-phone"])) : i.value === "phoneCode" ? (c(), k(ut, {
1000
- key: 2,
1001
- loading: o.loading,
1002
- size: o.size,
1003
- onSubmit: a
1004
- }, null, 8, ["loading", "size"])) : i.value === "emailCode" ? (c(), k(mt, {
1005
- key: 3,
1006
- loading: o.loading,
1007
- size: o.size,
1008
- onSubmit: a
1009
- }, null, 8, ["loading", "size"])) : z("", !0), l.value ? j(d.$slots, "OAuth", {
1010
- key: 4
1011
- }, void 0, !0) : z("", !0), s(ce, {
1012
- "show-sign-up": e.value.signUp.email || e.value.signUp.phone,
1013
- onSwitchSignUp: p,
1014
- onSwitchResetPassword: m
1015
- }, null, 8, ["show-sign-up"])]));
1016
- }
1017
- }), ht = /* @__PURE__ */ P(gt, [["__scopeId", "data-v-08b42828"]]), yt = {
1018
- class: "SignUpPhone"
1019
- }, wt = {
1020
- class: "content"
1021
- }, _t = {
1022
- class: "sendVerifyCodeItem"
1023
- }, bt = {
1024
- class: "handle"
1025
- }, St = /* @__PURE__ */ I({
1026
- __name: "AuthkitSignUpPhone",
1027
- props: {
1028
- size: {
1029
- type: String,
1030
- required: !0
1031
- },
1032
- loading: {
1033
- type: Boolean,
1034
- required: !0,
1035
- default: () => !1
1036
- },
1037
- /** 是否要求设置密码 */
1038
- requirePassword: {
1039
- type: Boolean,
1040
- default: !1
1041
- }
1042
- },
1043
- emits: ["switchSignIn", "submit"],
1044
- setup(g, {
1045
- emit: u
1046
- }) {
1047
- const n = u, o = g, v = S(), l = S(!1), r = S(), e = S({
1048
- phone: void 0,
1049
- code: void 0,
1050
- password: void 0,
1051
- confirmPassword: void 0,
1052
- inviteCode: void 0
1053
- });
1054
- F(() => {
1055
- const a = we();
1056
- a && (e.value.inviteCode = a);
1057
- });
1058
- const h = [{
1059
- required: !0,
1060
- message: "请输入确认密码"
1061
- }, {
1062
- validator: (a, d) => {
1063
- e.value.password && a !== e.value.password ? d("两次密码输入不一致") : d();
1064
- }
1065
- }];
1066
- function i() {
1067
- n("switchSignIn");
1068
- }
1069
- async function p() {
1070
- if (!await r.value.validateField(["phone"])) {
1071
- l.value = !0;
1072
- const {
1073
- error: d
1074
- } = await T.verify.sms.send.post({
1075
- phone: e.value.phone,
1076
- purpose: "signUp"
1077
- });
1078
- l.value = !1, d || v.value.startCountFn();
1079
- }
1080
- }
1081
- async function m() {
1082
- r.value.validate().then((a) => {
1083
- a || n("submit", {
1084
- type: "phone",
1085
- phone: e.value.phone,
1086
- code: e.value.code,
1087
- password: e.value.password,
1088
- inviteCode: e.value.inviteCode
1089
- });
1090
- });
1091
- }
1092
- return (a, d) => (c(), b("div", yt, [y("div", wt, [s(t(x), {
1093
- ref_key: "formRef",
1094
- ref: r,
1095
- model: e.value,
1096
- size: o.size,
1097
- "auto-label-width": ""
1098
- }, {
1099
- default: f(() => [s(t(A), {
1100
- field: "phone",
1101
- label: "手机号",
1102
- "hide-label": "",
1103
- rules: [{
1104
- required: !0,
1105
- message: "请输入手机号"
1106
- }, {
1107
- match: /^1[3-9]\d{9}$/,
1108
- message: "请输入有效的手机号"
1109
- }]
1110
- }, {
1111
- default: f(() => [s(t(V), {
1112
- modelValue: e.value.phone,
1113
- "onUpdate:modelValue": d[0] || (d[0] = (w) => e.value.phone = w),
1114
- placeholder: "请输入手机号",
1115
- autocomplete: "tel",
1116
- type: "tel"
1117
- }, null, 8, ["modelValue"])]),
1118
- _: 1
1119
- }), s(t(A), {
1120
- field: "code",
1121
- label: "验证码",
1122
- "hide-label": "",
1123
- rules: [{
1124
- required: !0,
1125
- message: "请输入验证码"
1126
- }]
1127
- }, {
1128
- default: f(() => [y("div", _t, [s(t(V), {
1129
- modelValue: e.value.code,
1130
- "onUpdate:modelValue": d[1] || (d[1] = (w) => e.value.code = w),
1131
- placeholder: "请输入验证码",
1132
- autocomplete: "one-time-code"
1133
- }, null, 8, ["modelValue"]), s(D, {
1134
- ref_key: "SendVerifyCodeRef",
1135
- ref: v,
1136
- size: o.size,
1137
- loading: l.value,
1138
- style: {
1139
- "margin-left": "10px"
1140
- },
1141
- onSend: p
1142
- }, null, 8, ["size", "loading"])])]),
1143
- _: 1
1144
- }), o.requirePassword ? (c(), k(t(A), {
1145
- key: 0,
1146
- field: "password",
1147
- label: "密码",
1148
- "hide-label": "",
1149
- rules: [{
1150
- required: o.requirePassword,
1151
- message: "密码请输入"
1152
- }, {
1153
- minLength: 10,
1154
- message: "密码不能少于10字符"
1155
- }]
1156
- }, {
1157
- default: f(() => [s(t(V), {
1158
- modelValue: e.value.password,
1159
- "onUpdate:modelValue": d[2] || (d[2] = (w) => e.value.password = w),
1160
- placeholder: "请输入密码(可选)",
1161
- type: "password",
1162
- autocomplete: "new-password"
1163
- }, null, 8, ["modelValue"])]),
1164
- _: 1
1165
- }, 8, ["rules"])) : z("", !0), o.requirePassword && e.value.password ? (c(), k(t(A), {
1166
- key: 1,
1167
- field: "confirmPassword",
1168
- label: "确认密码",
1169
- "hide-label": "",
1170
- rules: h
1171
- }, {
1172
- default: f(() => [s(t(V), {
1173
- modelValue: e.value.confirmPassword,
1174
- "onUpdate:modelValue": d[3] || (d[3] = (w) => e.value.confirmPassword = w),
1175
- placeholder: "请输入确认密码",
1176
- type: "password",
1177
- autocomplete: "new-password"
1178
- }, null, 8, ["modelValue"])]),
1179
- _: 1
1180
- })) : z("", !0), s(t(A), {
1181
- field: "inviteCode",
1182
- label: "邀请码",
1183
- "hide-label": "",
1184
- rules: [{
1185
- required: !1
1186
- }]
1187
- }, {
1188
- default: f(() => [s(t(V), {
1189
- modelValue: e.value.inviteCode,
1190
- "onUpdate:modelValue": d[4] || (d[4] = (w) => e.value.inviteCode = w),
1191
- placeholder: "邀请码(可选)",
1192
- autocomplete: "off"
1193
- }, null, 8, ["modelValue"])]),
1194
- _: 1
1195
- }), y("div", bt, [s(t(B), {
1196
- type: "primary",
1197
- loading: o.loading,
1198
- long: "",
1199
- size: o.size,
1200
- onClick: m
1201
- }, {
1202
- default: f(() => [...d[5] || (d[5] = [C(" 注册 ", -1)])]),
1203
- _: 1
1204
- }, 8, ["loading", "size"])])]),
1205
- _: 1
1206
- }, 8, ["model", "size"])]), s(ne, {
1207
- onSwitchSignIn: i
1208
- })]));
1209
- }
1210
- }), kt = /* @__PURE__ */ P(St, [["__scopeId", "data-v-47c89e83"]]), zt = {
1211
- class: "SignUp"
1212
- }, It = {
1213
- key: 0,
1214
- class: "tabsContainer"
1215
- }, Pt = {
1216
- key: 3,
1217
- class: "empty"
1218
- }, At = /* @__PURE__ */ I({
1219
- __name: "AuthkitSignUp",
1220
- props: {
1221
- size: {
1222
- type: String,
1223
- required: !0
1224
- },
1225
- loading: {
1226
- type: Boolean,
1227
- required: !0,
1228
- default: () => !0
1229
- }
1230
- },
1231
- emits: ["switchSignIn", "submit"],
1232
- setup(g, {
1233
- emit: u
1234
- }) {
1235
- const n = u, o = g, {
1236
- appsData: v
1237
- } = E(), l = $(() => v.value.authMethods), r = $(() => {
1238
- const p = [];
1239
- return l.value.signUp.email && p.push({
1240
- key: "email",
1241
- title: "邮箱注册"
1242
- }), l.value.signUp.phone && p.push({
1243
- key: "phone",
1244
- title: "手机号注册"
1245
- }), p;
1246
- }), e = S("email");
1247
- ee(() => {
1248
- var p;
1249
- r.value.some((m) => m.key === e.value) || (e.value = ((p = r.value[0]) == null ? void 0 : p.key) || "email");
1250
- });
1251
- function h() {
1252
- n("switchSignIn");
1253
- }
1254
- async function i(p) {
1255
- n("submit", {
1256
- type: e.value,
1257
- ...p
1258
- });
1259
- }
1260
- return (p, m) => (c(), b("div", zt, [r.value.length > 1 ? (c(), b("div", It, [s(t(oe), {
1261
- "active-key": e.value,
1262
- "onUpdate:activeKey": m[0] || (m[0] = (a) => e.value = a)
1263
- }, {
1264
- default: f(() => [(c(!0), b(N, null, te(r.value, (a) => (c(), k(t(se), {
1265
- key: a.key,
1266
- title: a.title
1267
- }, null, 8, ["title"]))), 128))]),
1268
- _: 1
1269
- }, 8, ["active-key"]), s(t(ae), {
1270
- class: "tabsDivider",
1271
- style: {
1272
- margin: "0"
1273
- }
1274
- })])) : z("", !0), e.value === "email" && l.value.signUp.email ? (c(), k(_e, {
1275
- key: 1,
1276
- size: o.size,
1277
- loading: g.loading,
1278
- onSubmit: i
1279
- }, null, 8, ["size", "loading"])) : e.value === "phone" && l.value.signUp.phone ? (c(), k(kt, {
1280
- key: 2,
1281
- size: o.size,
1282
- loading: g.loading,
1283
- onSubmit: i,
1284
- onSwitchSignIn: h
1285
- }, null, 8, ["size", "loading"])) : (c(), b("div", Pt, " 当前应用未开放用户注册 ")), e.value === "email" ? (c(), k(ne, {
1286
- key: 4,
1287
- onSwitchSignIn: h
1288
- })) : z("", !0)]));
1289
- }
1290
- }), Vt = /* @__PURE__ */ P(At, [["__scopeId", "data-v-b8936231"]]), Ut = ["src"], Ct = /* @__PURE__ */ I({
1291
- __name: "AuthkitAuthTitle",
1292
- props: {
1293
- size: {
1294
- type: [String, Number],
1295
- required: !1,
1296
- default: 30
1297
- },
1298
- fontSize: {
1299
- type: Number,
1300
- required: !1,
1301
- default: 18
1302
- },
1303
- lineHeight: {
1304
- type: Number,
1305
- required: !1,
1306
- default: 60
1307
- }
1308
- },
1309
- setup(g) {
1310
- const u = g, n = `${u.size}px`, o = `${u.fontSize}px`, v = `${u.lineHeight}px`, {
1311
- currentView: l
1312
- } = H(), {
1313
- appsData: r
1314
- } = E(), e = $(() => l.value === "signIn" ? `${r.value.name}登录` : l.value === "signUp" ? `${r.value.name}账号注册` : l.value === "resetPassword" ? `${r.value.name}密码重置` : "");
1315
- return (h, i) => (c(), b("div", {
1316
- class: "Title",
1317
- style: Q({
1318
- fontSize: o,
1319
- lineHeight: v
1320
- })
1321
- }, [t(r).applicationLogoUrl ? (c(), b("img", {
1322
- key: 0,
1323
- src: t(r).applicationLogoUrl,
1324
- srcset: "",
1325
- style: Q({
1326
- width: n
1327
- })
1328
- }, null, 12, Ut)) : z("", !0), y("span", null, O(e.value), 1), j(h.$slots, "default", {}, void 0, !0)], 4));
1329
- }
1330
- }), pe = /* @__PURE__ */ P(Ct, [["__scopeId", "data-v-8ebe7939"]]), $t = {
1331
- class: "Auth"
1332
- }, Rt = {
1333
- class: "body"
1334
- }, qt = /* @__PURE__ */ I({
1335
- __name: "AuthkitAuth",
1336
- props: {
1337
- size: {
1338
- type: String,
1339
- required: !0
1340
- },
1341
- showTitle: {
1342
- type: Boolean,
1343
- default: () => !0
1344
- }
1345
- },
1346
- emits: ["toPrivacyPolicy", "toUserServiceAgreement"],
1347
- setup(g, {
1348
- emit: u
1349
- }) {
1350
- const n = g, o = u, {
1351
- signInSubmit: v,
1352
- signUpSubmit: l,
1353
- resetPasswordSubmit: r,
1354
- currentView: e,
1355
- authSignInLoading: h,
1356
- authSignUpLoading: i,
1357
- resetPasswordLoading: p,
1358
- switchSignUp: m,
1359
- switchResetPassword: a,
1360
- switchSignIn: d
1361
- } = H();
1362
- function w() {
1363
- o("toPrivacyPolicy");
1364
- }
1365
- function _() {
1366
- o("toUserServiceAgreement");
1367
- }
1368
- return (U, R) => (c(), b("div", $t, [g.showTitle ? (c(), k(pe, {
1369
- key: 0,
1370
- size: 32,
1371
- "font-size": 20
1372
- })) : z("", !0), y("div", Rt, [t(e) === "signIn" ? (c(), k(ht, {
1373
- key: 0,
1374
- size: n.size,
1375
- loading: t(h),
1376
- onSwitchSignUp: t(m),
1377
- onSwitchResetPassword: t(a),
1378
- onSubmit: R[0] || (R[0] = (q) => t(v)(q))
1379
- }, {
1380
- OAuth: f(() => [s(Ce, {
1381
- size: n.size
1382
- }, null, 8, ["size"])]),
1383
- _: 1
1384
- }, 8, ["size", "loading", "onSwitchSignUp", "onSwitchResetPassword"])) : t(e) === "signUp" ? (c(), k(Vt, {
1385
- key: 1,
1386
- size: n.size,
1387
- loading: t(i),
1388
- onSwitchSignIn: t(d),
1389
- onSubmit: R[1] || (R[1] = (q) => t(l)(q))
1390
- }, null, 8, ["size", "loading", "onSwitchSignIn"])) : t(e) === "resetPassword" ? (c(), k(je, {
1391
- key: 2,
1392
- size: n.size,
1393
- loading: t(p),
1394
- onSwitchSignIn: t(d),
1395
- onSubmit: R[2] || (R[2] = (q) => t(r)(q))
1396
- }, null, 8, ["size", "loading", "onSwitchSignIn"])) : z("", !0), s(Je, {
1397
- onToPrivacyPolicy: w,
1398
- onToUserServiceAgreement: _
1399
- })])]));
1400
- }
1401
- }), Bt = /* @__PURE__ */ P(qt, [["__scopeId", "data-v-c04bb63f"]]), Tt = /* @__PURE__ */ I({
1402
- __name: "AuthkitAuthModal",
1403
- props: {
1404
- size: {
1405
- default: "large"
1406
- }
1407
- },
1408
- emits: ["close", "toPrivacyPolicy", "toUserServiceAgreement"],
1409
- setup(g, {
1410
- emit: u
1411
- }) {
1412
- const n = u, {
1413
- onSignIn: o
1414
- } = H(), {
1415
- isOpen: v,
1416
- close: l
1417
- } = ge();
1418
- let r = null;
1419
- F(() => {
1420
- r = o(() => l());
1421
- }), ie(() => {
1422
- r == null || r(), r = null;
1423
- });
1424
- function e(i) {
1425
- i || l();
1426
- }
1427
- function h() {
1428
- l(), n("close");
1429
- }
1430
- return (i, p) => (c(), k(t(fe), {
1431
- visible: t(v),
1432
- footer: !1,
1433
- "mask-closable": !1,
1434
- "title-align": "center",
1435
- "unmount-on-close": "",
1436
- width: t(ke),
1437
- "modal-class": "SignInModalClass",
1438
- "onUpdate:visible": e,
1439
- onClose: h
1440
- }, {
1441
- title: f(() => [s(pe)]),
1442
- default: f(() => [s(Bt, {
1443
- "show-title": !1,
1444
- size: g.size,
1445
- onToPrivacyPolicy: p[0] || (p[0] = (m) => n("toPrivacyPolicy")),
1446
- onToUserServiceAgreement: p[1] || (p[1] = (m) => n("toUserServiceAgreement"))
1447
- }, null, 8, ["size"])]),
1448
- _: 1
1449
- }, 8, ["visible", "width"]));
1450
- }
1451
- }), Ot = /* @__PURE__ */ P(Tt, [["__scopeId", "data-v-62ca7f24"]]), xt = /* @__PURE__ */ I({
1452
- __name: "AuthkitOAuthCallbackProvider",
1453
- props: {
1454
- bindIdentityRedirect: {
1455
- default: ""
1456
- },
1457
- closePopupOnBindSuccess: {
1458
- type: Boolean,
1459
- default: !0
1460
- },
1461
- restoreRedirectAfterSignIn: {
1462
- type: Boolean,
1463
- default: !0
1464
- }
1465
- },
1466
- setup(g) {
1467
- const u = g, n = ["token", "userId", "appId", "error", "needBindIdentity", "bindSuccess", "provider"], {
1468
- completeSignIn: o
1469
- } = H(), {
1470
- fetchUserProfile: v
1471
- } = J();
1472
- function l(i) {
1473
- return n.some((p) => i.searchParams.has(p));
1474
- }
1475
- function r(i) {
1476
- n.forEach((m) => i.searchParams.delete(m));
1477
- const p = `${i.pathname}${i.search}${i.hash}`;
1478
- window.history.replaceState({}, "", p);
1479
- }
1480
- function e() {
1481
- if (!u.restoreRedirectAfterSignIn) return null;
1482
- const i = sessionStorage.getItem("auth_redirect");
1483
- if (sessionStorage.removeItem("auth_redirect"), !i) return null;
1484
- const p = window.location.pathname + window.location.search + window.location.hash;
1485
- return i === p ? null : i;
1486
- }
1487
- async function h() {
1488
- if (typeof window > "u") return;
1489
- const i = new URL(window.location.href);
1490
- if (!l(i)) return;
1491
- const p = i.searchParams.get("error");
1492
- if (p) {
1493
- r(i), Z.error(p);
1494
- return;
1495
- }
1496
- if (i.searchParams.get("bindSuccess") === "true") {
1497
- const U = i.searchParams.get("provider");
1498
- r(i), await v(), Z.success(U ? `${U} 绑定成功` : "绑定成功"), u.closePopupOnBindSuccess && window.opener && setTimeout(() => window.close(), 800);
1499
- return;
1500
- }
1501
- const m = i.searchParams.get("token");
1502
- if (!m) return;
1503
- const a = i.searchParams.get("userId"), d = i.searchParams.get("appId"), w = i.searchParams.get("needBindIdentity") === "true";
1504
- if (r(i), o({
1505
- jwtToken: m,
1506
- userId: a,
1507
- appId: d,
1508
- needBindIdentity: w
1509
- }), await v(), w && u.bindIdentityRedirect) {
1510
- window.location.href = u.bindIdentityRedirect;
1511
- return;
1512
- }
1513
- const _ = e();
1514
- _ && (window.location.href = _);
1515
- }
1516
- return F(() => {
1517
- h();
1518
- }), (i, p) => null;
1519
- }
1520
- }), Vi = /* @__PURE__ */ I({
1521
- __name: "AuthkitProvider",
1522
- props: {
1523
- config: {},
1524
- handleOAuthCallback: {
1525
- type: Boolean,
1526
- default: !0
1527
- },
1528
- restoreSession: {
1529
- type: Boolean,
1530
- default: !0
1531
- },
1532
- fetchAppInfo: {
1533
- type: Boolean,
1534
- default: !0
1535
- },
1536
- showAuthModal: {
1537
- type: Boolean,
1538
- default: !0
1539
- },
1540
- authModalSize: {
1541
- default: "large"
1542
- },
1543
- bindIdentityRedirect: {
1544
- default: ""
1545
- },
1546
- closePopupOnBindSuccess: {
1547
- type: Boolean,
1548
- default: !0
1549
- },
1550
- restoreRedirectAfterSignIn: {
1551
- type: Boolean,
1552
- default: !0
1553
- }
1554
- },
1555
- emits: ["toPrivacyPolicy", "toUserServiceAgreement"],
1556
- setup(g, {
1557
- emit: u
1558
- }) {
1559
- const n = g, o = u;
1560
- n.config && he(n.config);
1561
- const {
1562
- restoreSession: v,
1563
- onSignIn: l,
1564
- onSignOut: r
1565
- } = H(), {
1566
- fetchUserProfile: e,
1567
- clearUserProfile: h
1568
- } = J(), {
1569
- appsAuthPageInfoApi: i
1570
- } = E(), p = l(() => {
1571
- e();
1572
- }), m = r(() => {
1573
- h();
1574
- });
1575
- return F(async () => {
1576
- n.fetchAppInfo && await i(), n.restoreSession && v() ? e() : h();
1577
- }), ie(() => {
1578
- p(), m();
1579
- }), (a, d) => (c(), b(N, null, [j(a.$slots, "default"), n.handleOAuthCallback ? (c(), k(xt, {
1580
- key: 0,
1581
- "bind-identity-redirect": n.bindIdentityRedirect,
1582
- "close-popup-on-bind-success": n.closePopupOnBindSuccess,
1583
- "restore-redirect-after-sign-in": n.restoreRedirectAfterSignIn
1584
- }, null, 8, ["bind-identity-redirect", "close-popup-on-bind-success", "restore-redirect-after-sign-in"])) : z("", !0), n.showAuthModal ? (c(), k(Ot, {
1585
- key: 1,
1586
- size: n.authModalSize,
1587
- onToPrivacyPolicy: d[0] || (d[0] = (w) => o("toPrivacyPolicy")),
1588
- onToUserServiceAgreement: d[1] || (d[1] = (w) => o("toUserServiceAgreement"))
1589
- }, null, 8, ["size"])) : z("", !0)], 64));
1590
- }
1591
- }), Lt = {
1592
- class: "header"
1593
- }, Mt = ["href"], Ft = {
1594
- class: "container"
1595
- }, Ht = /* @__PURE__ */ I({
1596
- __name: "AuthkitAuthContainer",
1597
- props: {
1598
- applicationLogoUrl: {
1599
- type: String,
1600
- required: !0,
1601
- default: () => ""
1602
- },
1603
- name: {
1604
- type: String,
1605
- required: !0,
1606
- default: () => ""
1607
- },
1608
- description: {
1609
- type: String,
1610
- required: !0,
1611
- default: () => ""
1612
- },
1613
- appHomePage: {
1614
- type: String,
1615
- required: !0,
1616
- default: () => ""
1617
- },
1618
- backgroundImage: {
1619
- type: String,
1620
- required: !0,
1621
- default: () => ""
1622
- },
1623
- backgroundColor: {
1624
- type: String,
1625
- required: !0,
1626
- default: () => ""
1627
- },
1628
- linkColor: {
1629
- type: String,
1630
- default: "var(--huyooo-accent-primary)"
1631
- },
1632
- backgroundType: {
1633
- type: String,
1634
- default: "color"
1635
- }
1636
- },
1637
- setup(g) {
1638
- const u = g, n = $(() => u.backgroundType === "color" ? {
1639
- backgroundColor: u.backgroundColor
1640
- } : {
1641
- backgroundImage: `url(${u.backgroundImage})`
1642
- });
1643
- return (o, v) => (c(), b("div", {
1644
- class: "auth",
1645
- style: Q(n.value)
1646
- }, [y("div", Lt, [u.name ? (c(), b("a", {
1647
- key: 0,
1648
- href: u.appHomePage,
1649
- target: "_self",
1650
- class: "link",
1651
- style: Q({
1652
- color: u.linkColor
1653
- })
1654
- }, " 返回主页 ", 12, Mt)) : z("", !0)]), y("div", Ft, [j(o.$slots, "default", {}, void 0, !0)])], 4));
1655
- }
1656
- }), Ui = /* @__PURE__ */ P(Ht, [["__scopeId", "data-v-0e13d3ff"]]), Et = {
1657
- class: "box"
1658
- }, Dt = {
1659
- class: "title"
1660
- }, Gt = {
1661
- class: "content"
1662
- }, Nt = {
1663
- class: "redirect"
1664
- }, jt = {
1665
- style: {
1666
- "font-weight": "bold",
1667
- "font-size": "12px"
1668
- }
1669
- }, Kt = /* @__PURE__ */ I({
1670
- __name: "AuthkitAuthorize",
1671
- props: {
1672
- size: {
1673
- type: String,
1674
- required: !0
1675
- },
1676
- title: {
1677
- type: String,
1678
- required: !0,
1679
- default: () => "授权登录"
1680
- },
1681
- logo: {
1682
- type: String,
1683
- required: !0,
1684
- default: () => ""
1685
- },
1686
- clientId: {
1687
- type: String,
1688
- required: !0,
1689
- default: () => ""
1690
- },
1691
- responseType: {
1692
- type: String,
1693
- required: !0,
1694
- default: () => ""
1695
- },
1696
- scope: {
1697
- type: String,
1698
- required: !0,
1699
- default: () => ""
1700
- },
1701
- state: {
1702
- type: String,
1703
- required: !0,
1704
- default: () => ""
1705
- },
1706
- redirectUri: {
1707
- type: String,
1708
- required: !0,
1709
- default: () => ""
1710
- },
1711
- userInfo: {
1712
- type: Object,
1713
- required: !0,
1714
- default: () => ""
1715
- }
1716
- },
1717
- setup(g) {
1718
- const u = S(!1), n = g, o = S({
1719
- name: "",
1720
- homePageUrl: "",
1721
- createAt: "",
1722
- authorizationCallback: ""
1723
- });
1724
- async function v() {
1725
- const {
1726
- data: r
1727
- } = await T.apps.authPageInfo.post({});
1728
- r && (o.value = {
1729
- name: r.name,
1730
- homePageUrl: r.homePageUrl || "",
1731
- createAt: "",
1732
- authorizationCallback: r.authorizationCallback || ""
1733
- });
1734
- }
1735
- v();
1736
- async function l() {
1737
- u.value = !0;
1738
- const {
1739
- data: r
1740
- } = await T.oauth2.authorize.post({
1741
- client_id: n.clientId,
1742
- response_type: n.responseType,
1743
- scope: n.scope,
1744
- state: n.state,
1745
- redirect_uri: n.redirectUri
1746
- });
1747
- u.value = !1, r && (window.location = r.authorizeUrl);
1748
- }
1749
- return (r, e) => (c(), b("div", Et, [y("div", Dt, O(`授权 ${o.value.name}`), 1), y("div", Gt, [s(t(ve), null, {
1750
- default: f(() => [s(t(X), null, {
1751
- default: f(() => {
1752
- var h;
1753
- return [s(t(Y), {
1754
- title: o.value.name,
1755
- description: `想要使用您的${(h = n.userInfo) == null ? void 0 : h.nickname}账户`
1756
- }, {
1757
- avatar: f(() => {
1758
- var i;
1759
- return [s(t(G), {
1760
- shape: "square",
1761
- "image-url": (i = n.userInfo) == null ? void 0 : i.avatar
1762
- }, null, 8, ["image-url"])];
1763
- }),
1764
- _: 1
1765
- }, 8, ["title", "description"])];
1766
- }),
1767
- _: 1
1768
- }), s(t(X), null, {
1769
- default: f(() => [s(t(Y), {
1770
- title: "公开信息",
1771
- description: "头像、昵称"
1772
- }, {
1773
- avatar: f(() => [s(t(G), {
1774
- shape: "square"
1775
- }, {
1776
- default: f(() => [...e[0] || (e[0] = [y("img", {
1777
- alt: "avatar",
1778
- src: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp"
1779
- }, null, -1)])]),
1780
- _: 1
1781
- })]),
1782
- _: 1
1783
- })]),
1784
- _: 1
1785
- }), s(t(X), null, {
1786
- default: f(() => [s(t(Y), {
1787
- title: "个人用户数据",
1788
- description: "电子邮件地址"
1789
- }, {
1790
- avatar: f(() => [s(t(G), {
1791
- shape: "square"
1792
- }, {
1793
- default: f(() => [...e[1] || (e[1] = [y("img", {
1794
- alt: "avatar",
1795
- src: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp"
1796
- }, null, -1)])]),
1797
- _: 1
1798
- })]),
1799
- _: 1
1800
- })]),
1801
- _: 1
1802
- })]),
1803
- _: 1
1804
- }), s(t(B), {
1805
- type: "primary",
1806
- size: n.size,
1807
- loading: u.value,
1808
- onClick: l
1809
- }, {
1810
- default: f(() => [...e[2] || (e[2] = [C(" 授权 ", -1)])]),
1811
- _: 1
1812
- }, 8, ["size", "loading"]), y("div", Nt, [e[3] || (e[3] = y("div", {
1813
- class: "redirect-hint"
1814
- }, "授权后将跳转至", -1)), y("div", jt, O(o.value.authorizationCallback), 1)])])]));
1815
- }
1816
- }), Ci = /* @__PURE__ */ P(Kt, [["__scopeId", "data-v-531351da"]]), Wt = {
1817
- class: "oauth-callback"
1818
- }, Qt = {
1819
- key: 0,
1820
- class: "callback-loading"
1821
- }, Jt = {
1822
- key: 1,
1823
- class: "callback-error"
1824
- }, Xt = {
1825
- key: 2,
1826
- class: "callback-success"
1827
- }, Yt = /* @__PURE__ */ I({
1828
- __name: "AuthkitOauthCallback",
1829
- props: {
1830
- defaultRedirect: {},
1831
- loadingText: {},
1832
- bindIdentityRedirect: {}
1833
- },
1834
- emits: ["success", "error", "needBindIdentity"],
1835
- setup(g, {
1836
- emit: u
1837
- }) {
1838
- const n = g, o = u, v = S(!0), l = S(""), r = S("登录成功,正在跳转..."), {
1839
- completeSignIn: e,
1840
- restoreSession: h
1841
- } = H(), {
1842
- fetchUserProfile: i
1843
- } = J();
1844
- async function p() {
1845
- const a = new URLSearchParams(window.location.search), d = a.get("error");
1846
- if (d) {
1847
- l.value = d, v.value = !1, o("error", l.value);
1848
- return;
1849
- }
1850
- if (a.get("bindSuccess") === "true") {
1851
- r.value = "绑定成功,可以关闭此页面", window.history.replaceState({}, "", window.location.pathname), v.value = !1, setTimeout(() => {
1852
- window.close();
1853
- }, 800);
1854
- return;
1855
- }
1856
- const w = a.get("token"), _ = a.get("userId"), U = a.get("appId"), R = a.get("needBindIdentity") === "true";
1857
- if (!w) {
1858
- l.value = "登录失败:未收到认证令牌", v.value = !1, o("error", l.value);
1859
- return;
1860
- }
1861
- try {
1862
- e({
1863
- jwtToken: w,
1864
- userId: _,
1865
- appId: U,
1866
- needBindIdentity: R
1867
- }), await i();
1868
- const q = window.location.pathname;
1869
- if (window.history.replaceState({}, "", q), R && (o("needBindIdentity", {
1870
- token: w,
1871
- userId: _ || "",
1872
- appId: U || ""
1873
- }), n.bindIdentityRedirect)) {
1874
- v.value = !1, setTimeout(() => {
1875
- window.location.href = n.bindIdentityRedirect;
1876
- }, 300);
1877
- return;
1878
- }
1879
- o("success", {
1880
- token: w,
1881
- userId: _ || "",
1882
- appId: U || "",
1883
- needBindIdentity: R
1884
- });
1885
- const L = sessionStorage.getItem("auth_redirect");
1886
- sessionStorage.removeItem("auth_redirect");
1887
- const K = L || n.defaultRedirect || "/";
1888
- v.value = !1, setTimeout(() => {
1889
- window.location.href = K;
1890
- }, 500);
1891
- } catch (q) {
1892
- console.error("OAuth 回调处理失败:", q), l.value = "登录处理失败,请重试", v.value = !1, o("error", l.value);
1893
- }
1894
- }
1895
- function m() {
1896
- const a = sessionStorage.getItem("auth_redirect");
1897
- sessionStorage.removeItem("auth_redirect"), window.location.href = a || n.defaultRedirect || "/";
1898
- }
1899
- return F(() => {
1900
- const a = new URLSearchParams(window.location.search);
1901
- if (a.has("token") || a.has("error") || a.has("bindSuccess"))
1902
- p();
1903
- else if (h()) {
1904
- const d = sessionStorage.getItem("auth_redirect");
1905
- sessionStorage.removeItem("auth_redirect"), window.location.href = d || n.defaultRedirect || "/";
1906
- } else
1907
- l.value = "无效的访问", v.value = !1;
1908
- }), (a, d) => (c(), b("div", Wt, [v.value ? (c(), b("div", Qt, [d[0] || (d[0] = y("div", {
1909
- class: "spinner"
1910
- }, null, -1)), y("p", null, O(g.loadingText), 1)])) : l.value ? (c(), b("div", Jt, [d[1] || (d[1] = y("div", {
1911
- class: "error-icon"
1912
- }, "✕", -1)), d[2] || (d[2] = y("h2", null, "登录失败", -1)), y("p", null, O(l.value), 1), y("button", {
1913
- class: "retry-btn",
1914
- onClick: m
1915
- }, "返回重试")])) : (c(), b("div", Xt, [d[3] || (d[3] = y("div", {
1916
- class: "success-icon"
1917
- }, "✓", -1)), y("p", null, O(r.value), 1)]))]));
1918
- }
1919
- }), $i = /* @__PURE__ */ P(Yt, [["__scopeId", "data-v-4b4b59a1"]]), Zt = {
1920
- class: "BindEmail"
1921
- }, ei = {
1922
- class: "content"
1923
- }, ti = {
1924
- class: "sendVerifyCodeItem"
1925
- }, ii = {
1926
- class: "handle"
1927
- }, oi = {
1928
- key: 0,
1929
- class: "skip"
1930
- }, si = /* @__PURE__ */ I({
1931
- __name: "AuthkitBindEmail",
1932
- props: {
1933
- size: {
1934
- type: String,
1935
- required: !0
1936
- },
1937
- loading: {
1938
- type: Boolean,
1939
- required: !0,
1940
- default: () => !1
1941
- },
1942
- /** 是否显示跳过按钮 */
1943
- showSkip: {
1944
- type: Boolean,
1945
- default: !1
1946
- }
1947
- },
1948
- emits: ["submit", "skip"],
1949
- setup(g, {
1950
- emit: u
1951
- }) {
1952
- const n = u, o = g, v = S(), l = S(!1), r = S(), e = S({
1953
- email: void 0,
1954
- userToken: void 0,
1955
- emailVerifyId: void 0
1956
- });
1957
- async function h() {
1958
- if (!await r.value.validateField(["email"])) {
1959
- l.value = !0;
1960
- const {
1961
- data: a
1962
- } = await T.verify.email.retry.post({
1963
- email: e.value.email,
1964
- purpose: "bindEmail"
1965
- });
1966
- l.value = !1, a && (e.value.emailVerifyId = a.emailVerifyId, v.value.startCountFn());
1967
- }
1968
- }
1969
- async function i() {
1970
- r.value.validate().then((m) => {
1971
- m || n("submit", {
1972
- email: e.value.email,
1973
- userToken: e.value.userToken,
1974
- emailVerifyId: e.value.emailVerifyId
1975
- });
1976
- });
1977
- }
1978
- function p() {
1979
- n("skip");
1980
- }
1981
- return (m, a) => (c(), b("div", Zt, [a[4] || (a[4] = y("div", {
1982
- class: "header"
1983
- }, [y("h3", {
1984
- class: "title"
1985
- }, "绑定邮箱"), y("p", {
1986
- class: "subtitle"
1987
- }, "请绑定邮箱以完成账号设置,绑定后可使用邮箱登录")], -1)), y("div", ei, [s(t(x), {
1988
- ref_key: "formRef",
1989
- ref: r,
1990
- model: e.value,
1991
- size: o.size,
1992
- "auto-label-width": ""
1993
- }, {
1994
- default: f(() => [s(t(A), {
1995
- field: "email",
1996
- label: "邮箱",
1997
- "hide-label": "",
1998
- rules: [{
1999
- required: !0,
2000
- message: "请输入邮箱"
2001
- }, {
2002
- type: "email",
2003
- message: "请输入有效的邮箱"
2004
- }]
2005
- }, {
2006
- default: f(() => [s(t(V), {
2007
- modelValue: e.value.email,
2008
- "onUpdate:modelValue": a[0] || (a[0] = (d) => e.value.email = d),
2009
- placeholder: "请输入邮箱",
2010
- autocomplete: "email",
2011
- type: "email"
2012
- }, null, 8, ["modelValue"])]),
2013
- _: 1
2014
- }), s(t(A), {
2015
- field: "userToken",
2016
- label: "验证码",
2017
- "hide-label": "",
2018
- rules: [{
2019
- required: !0,
2020
- message: "请输入验证码"
2021
- }]
2022
- }, {
2023
- default: f(() => [y("div", ti, [s(t(V), {
2024
- modelValue: e.value.userToken,
2025
- "onUpdate:modelValue": a[1] || (a[1] = (d) => e.value.userToken = d),
2026
- placeholder: "请输入验证码",
2027
- autocomplete: "one-time-code"
2028
- }, null, 8, ["modelValue"]), s(D, {
2029
- ref_key: "SendVerifyCodeRef",
2030
- ref: v,
2031
- size: o.size,
2032
- loading: l.value,
2033
- style: {
2034
- "margin-left": "10px"
2035
- },
2036
- onSend: h
2037
- }, null, 8, ["size", "loading"])])]),
2038
- _: 1
2039
- }), y("div", ii, [s(t(B), {
2040
- type: "primary",
2041
- loading: o.loading,
2042
- long: "",
2043
- size: o.size,
2044
- onClick: i
2045
- }, {
2046
- default: f(() => [...a[2] || (a[2] = [C(" 绑定邮箱 ", -1)])]),
2047
- _: 1
2048
- }, 8, ["loading", "size"])])]),
2049
- _: 1
2050
- }, 8, ["model", "size"])]), o.showSkip ? (c(), b("div", oi, [s(t(M), {
2051
- onClick: p
2052
- }, {
2053
- default: f(() => [...a[3] || (a[3] = [C("稍后绑定", -1)])]),
2054
- _: 1
2055
- })])) : z("", !0)]));
2056
- }
2057
- }), Ri = /* @__PURE__ */ P(si, [["__scopeId", "data-v-2432c885"]]), ai = {
2058
- class: "oauth-binding-account"
2059
- }, ni = {
2060
- class: "oauth-binding-account__info"
2061
- }, li = {
2062
- class: "oauth-binding-account__name"
2063
- }, ri = /* @__PURE__ */ I({
2064
- __name: "AuthkitGithubBinding",
2065
- props: {
2066
- size: {
2067
- type: String,
2068
- required: !0
2069
- }
2070
- },
2071
- setup(g) {
2072
- const {
2073
- userProfile: u,
2074
- fetchUserProfile: n
2075
- } = J(), o = S("hidden"), v = S(!1);
2076
- let l;
2077
- const r = g, e = $(() => {
2078
- var w, _, U;
2079
- return ((_ = (w = u.value) == null ? void 0 : w.github) == null ? void 0 : _.avatar_url) || ((U = u.value) == null ? void 0 : U.avatar) || "";
2080
- }), {
2081
- getOauthCallbackUrl: h
2082
- } = ue();
2083
- function i(w) {
2084
- o.value = w;
2085
- }
2086
- async function p() {
2087
- const w = ye.appId;
2088
- if (!w) {
2089
- console.error("GitHub OAuth 失败: appId 未配置");
2090
- return;
2091
- }
2092
- const {
2093
- data: _
2094
- } = await T.oauth.github.login.get({
2095
- appId: w,
2096
- mode: "bind",
2097
- redirectUri: h()
2098
- });
2099
- if (_) {
2100
- const {
2101
- redirectUri: U
2102
- } = _;
2103
- v.value = !0, window.open(U, "_blank");
2104
- }
2105
- }
2106
- async function m() {
2107
- const {
2108
- error: w
2109
- } = await T.users.unbind.oauth.post({
2110
- provider: "github"
2111
- });
2112
- w || (Z.success("解绑成功"), o.value = "hidden", n());
2113
- }
2114
- function a() {
2115
- o.value === "bind" && (o.value = "hidden", p()), o.value === "unbind" && m();
2116
- }
2117
- function d() {
2118
- v.value && n();
2119
- }
2120
- return F(() => {
2121
- u.value || n(), l = setInterval(d, 1e3);
2122
- }), ie(() => {
2123
- l && clearInterval(l);
2124
- }), (w, _) => {
2125
- var U, R, q;
2126
- return c(), b(N, null, [!((U = t(u)) != null && U.github) && o.value === "hidden" ? (c(), k(t(le), {
2127
- key: 0,
2128
- title: "绑定GitHub"
2129
- }, {
2130
- action: f(() => [s(t(B), {
2131
- size: r.size,
2132
- type: "primary",
2133
- onClick: _[0] || (_[0] = (L) => i("bind"))
2134
- }, {
2135
- default: f(() => [..._[2] || (_[2] = [C(" 绑定GitHub ", -1)])]),
2136
- _: 1
2137
- }, 8, ["size"])]),
2138
- default: f(() => [_[3] || (_[3] = C(" 您还未绑定GitHub账号,请点击绑定。 ", -1))]),
2139
- _: 1
2140
- })) : z("", !0), (R = t(u)) != null && R.github && o.value === "hidden" ? (c(), k(t(le), {
2141
- key: 1,
2142
- title: "解绑GitHub"
2143
- }, {
2144
- action: f(() => [s(t(B), {
2145
- size: r.size,
2146
- type: "primary",
2147
- onClick: _[1] || (_[1] = (L) => i("unbind"))
2148
- }, {
2149
- default: f(() => [..._[5] || (_[5] = [C(" 解绑GitHub ", -1)])]),
2150
- _: 1
2151
- }, 8, ["size"])]),
2152
- default: f(() => {
2153
- var L, K;
2154
- return [y("div", ai, [e.value ? (c(), k(t(G), {
2155
- key: 0,
2156
- class: "oauth-binding-account__avatar",
2157
- "image-url": e.value,
2158
- size: 42
2159
- }, null, 8, ["image-url"])) : (c(), k(t(G), {
2160
- key: 1,
2161
- class: "oauth-binding-account__avatar oauth-binding-account__avatar--placeholder",
2162
- size: 42
2163
- }, {
2164
- default: f(() => [s(t(de), {
2165
- icon: "bi:github",
2166
- width: 22
2167
- })]),
2168
- _: 1
2169
- })), y("div", ni, [_[4] || (_[4] = y("div", {
2170
- class: "oauth-binding-account__provider"
2171
- }, "GitHub", -1)), y("div", li, O(((K = (L = t(u)) == null ? void 0 : L.github) == null ? void 0 : K.login) || "GitHub"), 1)])])];
2172
- }),
2173
- _: 1
2174
- })) : z("", !0), o.value === "bind" || o.value === "unbind" ? (c(), k(be, {
2175
- key: 2,
2176
- size: r.size,
2177
- email: (q = t(u)) == null ? void 0 : q.email,
2178
- onNext: a
2179
- }, null, 8, ["size", "email"])) : z("", !0)], 64);
2180
- };
2181
- }
2182
- }), qi = /* @__PURE__ */ P(ri, [["__scopeId", "data-v-6ab8a1f9"]]);
2183
- export {
2184
- Bt as A,
2185
- W as O,
2186
- et as P,
2187
- je as R,
2188
- Je as S,
2189
- xt as _,
2190
- Ui as a,
2191
- Ot as b,
2192
- pe as c,
2193
- Ci as d,
2194
- Ri as e,
2195
- qi as f,
2196
- $i as g,
2197
- Ce as h,
2198
- Te as i,
2199
- Me as j,
2200
- Vi as k,
2201
- ht as l,
2202
- ut as m,
2203
- Vt as n,
2204
- kt as o,
2205
- ne as p,
2206
- ce as q
2207
- };