@huyooo/ui 1.0.2 → 1.0.4

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 (182) hide show
  1. package/dist/AuthkitAppSetting-BN8-xgNq.js +2674 -0
  2. package/dist/{Contact-M6iyuyNL.js → Contact-DBH8CyKp.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-r-t3H1X0.js} +87 -88
  7. package/dist/LandingPageSectionHeader-CVAqc7bx.js +137 -0
  8. package/dist/{LandingPageSectionTabs-Ce3_Rc2L.js → LandingPageSectionTabs-DhKpOj5F.js} +300 -309
  9. package/dist/LegalDocViewer-DlaLKGyX.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-DoWP5aX7.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/LandingPageContainer.vue.d.ts +2 -2
  56. package/dist/components/LandingPage/LandingPagePageContent.vue.d.ts +2 -2
  57. package/dist/components/LegalDoc/LegalDocViewer.vue.d.ts +7 -0
  58. package/dist/components/Menu.vue.d.ts +2 -1
  59. package/dist/components/MenuItem.vue.d.ts +3 -1
  60. package/dist/components/Message/MessageAppMessage.vue.d.ts +12 -2
  61. package/dist/components/Message/MessageDetails.vue.d.ts +9 -161
  62. package/dist/components/Message/MessageHandle.vue.d.ts +16 -4
  63. package/dist/components/Message/MessageList.vue.d.ts +4 -3
  64. package/dist/components/Message/MessageNotificationDetails.vue.d.ts +13 -0
  65. package/dist/components/Message/messageBody/DescriptionsMessageBody.vue.d.ts +3 -0
  66. package/dist/components/Message/messageBody/JsonMessageBodyFallback.vue.d.ts +3 -0
  67. package/dist/components/Message/messageBody/TextMessageBody.vue.d.ts +3 -0
  68. package/dist/components/Message/messageBody/descriptionRows.d.ts +14 -0
  69. package/dist/components/Message/messageBody/descriptionsMessageBody.d.ts +32 -0
  70. package/dist/components/Message/messageBody/descriptionsValueRender.d.ts +4 -0
  71. package/dist/components/Message/messageBody/messageBodyRegistry.d.ts +9 -0
  72. package/dist/components/Message/messageBody/registerBuiltinMessageBodies.d.ts +2 -0
  73. package/dist/components/Message/messageBody/types.d.ts +7 -0
  74. package/dist/components/Referrer/ReferrerRefereeCell.vue.d.ts +7 -0
  75. package/dist/components/Referrer/ReferrerReferees.vue.d.ts +1 -0
  76. package/dist/components/UserMenu/UserAccountMenu.vue.d.ts +1 -16
  77. package/dist/components/UserMenu/UserMenuItem.vue.d.ts +4 -0
  78. package/dist/components/UserMenu/UserMenuModals.vue.d.ts +18 -4
  79. package/dist/components/UserMenu/parts/UserAvatar.vue.d.ts +6 -0
  80. package/dist/components/UserMenu/parts/UserBasicInformation.vue.d.ts +7 -2
  81. package/dist/composables/Authkit/fetchAuthPageAboutUs.d.ts +3 -0
  82. package/dist/composables/Authkit/resolveRoutePermission.d.ts +2 -0
  83. package/dist/composables/Authkit/useAuthkitAppsAuthPageInfo.d.ts +16 -0
  84. package/dist/composables/Authkit/useAuthkitAuth.d.ts +2 -0
  85. package/dist/composables/Authkit/useAuthkitPasskey.d.ts +10 -0
  86. package/dist/composables/Authkit/useLegalDocHostActions.d.ts +6 -0
  87. package/dist/composables/Authkit/useLegalDocs.d.ts +19 -0
  88. package/dist/composables/Authkit/useOauth.d.ts +17 -4
  89. package/dist/composables/Authkit/useRegistrationTerms.d.ts +24 -0
  90. package/dist/composables/Authkit/verifyCodeCooldown.d.ts +19 -0
  91. package/dist/composables/Billing/useBillingPlans.d.ts +0 -4
  92. package/dist/composables/Billing/useBillingStatusOptions.d.ts +2 -6
  93. package/dist/composables/Billing/useBillingSubscriptionSummary.d.ts +16 -0
  94. package/dist/composables/Billing/usePaidProductOptions.d.ts +5 -0
  95. package/dist/composables/Message/messageCenterBadgeCounts.d.ts +28 -0
  96. package/dist/composables/UserMenu/useUserMenuBadgeCounts.d.ts +9 -0
  97. package/dist/composables/useInfiniteList.d.ts +19 -0
  98. package/dist/composables/useMessageNotifications.d.ts +3 -6
  99. package/dist/composables.d.ts +4 -2
  100. package/dist/composables.js +50 -45
  101. package/dist/feedback.d.ts +1 -0
  102. package/dist/feedback.js +12 -11
  103. package/dist/fetchAuthPageAboutUs-dzTSwRsB.js +25 -0
  104. package/dist/{Clipboard-Bo7gdpR6.js → index-BkLvw1PU.js} +1 -1
  105. package/dist/landingPage.js +21 -21
  106. package/dist/legalDocs/buildBuiltinUrl.d.ts +3 -0
  107. package/dist/{utils/legalLinks.d.ts → legalDocs/constants.d.ts} +0 -10
  108. package/dist/legalDocs/index.d.ts +7 -0
  109. package/dist/legalDocs/isConfigured.d.ts +7 -0
  110. package/dist/legalDocs/open.d.ts +3 -0
  111. package/dist/legalDocs/resolveAppId.d.ts +8 -0
  112. package/dist/legalDocs/resolveTarget.d.ts +4 -0
  113. package/dist/legalDocs/types.d.ts +12 -0
  114. package/dist/main.js +320 -308
  115. package/dist/message.d.ts +3 -0
  116. package/dist/message.js +301 -21
  117. package/dist/pay.d.ts +1 -1
  118. package/dist/pay.js +14 -17
  119. package/dist/privateCom.js +1 -1
  120. package/dist/referrer.js +1 -1
  121. package/dist/style.css +1 -1
  122. package/dist/types/api/auth.generated.d.ts +1385 -328
  123. package/dist/types/api/billing.generated.d.ts +907 -76
  124. package/dist/types/api/ones.generated.d.ts +131 -2
  125. package/dist/types/api.d.ts +1 -0
  126. package/dist/types/app.d.ts +10 -0
  127. package/dist/types/user.d.ts +1 -0
  128. package/dist/upload.js +2 -2
  129. package/dist/{useAuthkitAppsAuthPageInfo-C2yKgl8t.js → useAuthkitAppsAuthPageInfo-CNudJd04.js} +18 -17
  130. package/dist/useAuthkitAuth-3m0yW6uP.js +267 -0
  131. package/dist/{useAuthkitCreateAndUpdate-oo9517Gj.js → useAuthkitCreateAndUpdate-BsINsI-E.js} +1 -1
  132. package/dist/{useAuthkitUsersProfile-BZDk21c8.js → useAuthkitUsersProfile-DJlMsftY.js} +3 -3
  133. package/dist/useBillingStatusOptions-CfHQOFNw.js +71 -0
  134. package/dist/{useEnsureAuthenticated-BuIbxqsO.js → useEnsureAuthenticated-DNkCCy_Y.js} +2 -2
  135. package/dist/useLegalDocs-DQP_Yq6B.js +106 -0
  136. package/dist/{useMessageNotifications-D85_-mDq.js → useMessageNotifications-CAphguOm.js} +21 -24
  137. package/dist/useRoutePermission-CEiya9AM.js +218 -0
  138. package/dist/useSEO-CDWxbk8B.js +221 -0
  139. package/dist/useSubscriptionCheckout-d_M_rKRa.js +368 -0
  140. package/dist/{useUploadCos-BRKRzSy3.js → useUploadCos-C8BqFPkx.js} +1 -1
  141. package/dist/user.js +1 -1
  142. package/dist/userMenuModal-D-nDaYqM.js +66 -0
  143. package/dist/utils/apiMiddlewares.d.ts +5 -5
  144. package/dist/utils/apiResponse.d.ts +11 -0
  145. package/dist/utils/authProviderIcon.d.ts +3 -0
  146. package/dist/utils/authkit.d.ts +20 -7
  147. package/dist/utils/formatPoints.d.ts +8 -0
  148. package/dist/utils/messageNotificationContent.d.ts +4 -0
  149. package/dist/utils/messageTextLink.d.ts +9 -0
  150. package/dist/utils/passkeySupport.d.ts +8 -0
  151. package/dist/utils/pointsFlowTypes.d.ts +10 -0
  152. package/dist/utils/pointsHistoryDisplay.d.ts +8 -0
  153. package/dist/utils/refundStatusDisplay.d.ts +1 -0
  154. package/dist/utils/subscriptionDisplay.d.ts +7 -0
  155. package/dist/utils/userDisplay.d.ts +41 -0
  156. package/package.json +11 -3
  157. package/dist/AuthkitAppSetting-C-0uuLSg.js +0 -1921
  158. package/dist/AuthkitGithubBinding-C5zEy9zN.js +0 -2207
  159. package/dist/CustomTable-CCOQxfxr.js +0 -279
  160. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-M1NQ-rx-.js +0 -1396
  161. package/dist/LandingPageFAQ-CZJXvor9.js +0 -80
  162. package/dist/LandingPageSectionHeader-D_74W4My.js +0 -69
  163. package/dist/Menu-Cy2ZPeaz.js +0 -170
  164. package/dist/MessageHandle-BG12aX0i.js +0 -924
  165. package/dist/MessageList-CrCF8mU6.js +0 -233
  166. package/dist/MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-gsjL6yAe.js +0 -142
  167. package/dist/PaySubscriptions-C3KiTsQS.js +0 -1241
  168. package/dist/PricingPlans-uwlFiiJx.js +0 -404
  169. package/dist/ReferrerReferees-Zb5Bd-_e.js +0 -106
  170. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-QWUNRjGh.js +0 -520
  171. package/dist/WidthContainer-BVBk0kJN.js +0 -688
  172. package/dist/components/Feedback/FeedbackDetails.vue.d.ts +0 -178
  173. package/dist/composables/Authkit/useLegalLinks.d.ts +0 -34
  174. package/dist/index-D3Kp6R4z.js +0 -4
  175. package/dist/useAuthkitAuth-DmS-H7M2.js +0 -175
  176. package/dist/useBillingStatusOptions-B7xLU3fs.js +0 -145
  177. package/dist/useLegalLinks-Cwr45PBT.js +0 -60
  178. package/dist/useRoutePermission-CaWtjLRA.js +0 -212
  179. package/dist/useSEO-BSMQdBR9.js +0 -158
  180. package/dist/useSubscriptionCheckout-BRk5h9aC.js +0 -365
  181. package/dist/useTableHandle-BdujaiNX.js +0 -69
  182. /package/dist/components/{Feedback/FeedbackVideoPreview.vue.d.ts → VideoPreview.vue.d.ts} +0 -0
@@ -1,1921 +0,0 @@
1
- /* empty css */
2
- /* empty css */
3
- import { U as be } from "./index-D3Kp6R4z.js";
4
- import { defineComponent as O, computed as $, openBlock as h, createElementBlock as j, normalizeStyle as ke, normalizeClass as _e, createElementVNode as C, ref as y, createBlock as w, unref as e, withCtx as a, createVNode as i, createTextVNode as k, onMounted as X, onUnmounted as fe, withDirectives as we, toDisplayString as T, vShow as ze, Fragment as Z, createCommentVNode as P, renderList as Ve, watch as de, isRef as Ce } from "vue";
5
- import { Form as J, FormItem as A, Avatar as se, Input as M, Textarea as $e, Button as S, Message as W, Alert as D, Link as Ie, Space as ce, InputPassword as Pe, Result as Se, Modal as Ae } from "@arco-design/web-vue";
6
- /* empty css */
7
- import { e as U, g as ee, p as me } from "./apiClients-DrGX2iJy.js";
8
- /* empty css */
9
- import { u as Ue } from "./useUploadCos-BRKRzSy3.js";
10
- import { _ as xe, g as qe, i as Te } from "./plugin-vue_export-helper-LjDO2Zua.js";
11
- import { _ as H } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
- import { u as te } from "./useAuthkitUsersProfile-BZDk21c8.js";
13
- import { Icon as Be } from "@iconify/vue";
14
- import { u as pe } from "./useAuthkitAppsAuthPageInfo-C2yKgl8t.js";
15
- import { u as Re } from "./useAuthkitAuth-DmS-H7M2.js";
16
- import { M as Ee } from "./Menu-Cy2ZPeaz.js";
17
- import { u as Le } from "./useAuthkitCreateAndUpdate-oo9517Gj.js";
18
- const Ne = O({
19
- name: "IconCamera",
20
- props: {
21
- size: {
22
- type: [Number, String]
23
- },
24
- strokeWidth: {
25
- type: Number,
26
- default: 4
27
- },
28
- strokeLinecap: {
29
- type: String,
30
- default: "butt",
31
- validator: (f) => ["butt", "round", "square"].includes(f)
32
- },
33
- strokeLinejoin: {
34
- type: String,
35
- default: "miter",
36
- validator: (f) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(f)
37
- },
38
- rotate: Number,
39
- spin: Boolean
40
- },
41
- emits: {
42
- click: (f) => !0
43
- },
44
- setup(f, {
45
- emit: l
46
- }) {
47
- const g = qe("icon"), m = $(() => [g, `${g}-camera`, {
48
- [`${g}-spin`]: f.spin
49
- }]), r = $(() => {
50
- const o = {};
51
- return f.size && (o.fontSize = Te(f.size) ? `${f.size}px` : f.size), f.rotate && (o.transform = `rotate(${f.rotate}deg)`), o;
52
- });
53
- return {
54
- cls: m,
55
- innerStyle: r,
56
- onClick: (o) => {
57
- l("click", o);
58
- }
59
- };
60
- }
61
- }), Me = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
62
- function Oe(f, l, g, m, r, v) {
63
- return h(), j("svg", {
64
- viewBox: "0 0 48 48",
65
- fill: "none",
66
- xmlns: "http://www.w3.org/2000/svg",
67
- stroke: "currentColor",
68
- class: _e(f.cls),
69
- style: ke(f.innerStyle),
70
- "stroke-width": f.strokeWidth,
71
- "stroke-linecap": f.strokeLinecap,
72
- "stroke-linejoin": f.strokeLinejoin,
73
- onClick: l[0] || (l[0] = (...o) => f.onClick && f.onClick(...o))
74
- }, l[1] || (l[1] = [C("path", {
75
- d: "m33 12-1.862-3.724A.5.5 0 0 0 30.691 8H17.309a.5.5 0 0 0-.447.276L15 12m16 14a7 7 0 1 1-14 0 7 7 0 0 1 14 0ZM7 40h34a1 1 0 0 0 1-1V13a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1v26a1 1 0 0 0 1 1Z"
76
- }, null, -1)]), 14, Me);
77
- }
78
- var ne = /* @__PURE__ */ xe(Ne, [["render", Oe]]);
79
- const Fe = Object.assign(ne, {
80
- install: (f, l) => {
81
- var g;
82
- const m = (g = l == null ? void 0 : l.iconPrefix) != null ? g : "";
83
- f.component(m + ne.name, ne);
84
- }
85
- }), De = {
86
- class: "handle"
87
- }, je = /* @__PURE__ */ O({
88
- __name: "AuthkitPersonalInformation",
89
- props: {
90
- size: {
91
- type: String,
92
- required: !0
93
- }
94
- },
95
- emits: ["submit"],
96
- setup(f, {
97
- emit: l
98
- }) {
99
- const g = l, m = f, r = y({
100
- id: void 0,
101
- nickname: "",
102
- description: "",
103
- avatar: "",
104
- avatarUrl: ""
105
- }), v = y(!1), o = y(), t = y(!1), V = {
106
- color: "var(--huyooo-accent-primary)"
107
- };
108
- async function u() {
109
- t.value = !0;
110
- const {
111
- data: s
112
- } = await U.users.profile.post({});
113
- t.value = !1, s && (r.value.id = s.id, r.value.nickname = s.nickname, r.value.description = s.description, r.value.avatar = s.avatar, r.value.avatarUrl = s.avatarUrl);
114
- }
115
- async function n() {
116
- if (!await o.value.validate()) {
117
- t.value = !0;
118
- const d = {
119
- id: r.value.id,
120
- nickname: r.value.nickname,
121
- description: r.value.description,
122
- avatar: r.value.avatar
123
- }, {
124
- data: z,
125
- error: E
126
- } = await U.users.update.baseInfo.post(d);
127
- t.value = !1, !E && z && (W.success("更新成功"), r.value.avatarUrl = z.avatarUrl, g("submit"));
128
- }
129
- }
130
- u();
131
- const p = () => {
132
- const {
133
- uploadFile: s
134
- } = Ue(), d = document.createElement("input");
135
- d.type = "file", d.accept = "image/*", d.style.display = "none", document.body.append(d), d.addEventListener("change", async (z) => {
136
- var N;
137
- const x = (N = z.target.files) == null ? void 0 : N[0];
138
- if (x) {
139
- v.value = !0;
140
- try {
141
- s({
142
- bucketId: ee.avatarBucketId,
143
- file: x,
144
- onFileFinish(L, K, _) {
145
- v.value = !0;
146
- const I = {
147
- id: r.value.id,
148
- nickname: r.value.nickname,
149
- description: r.value.description,
150
- avatar: _.Key
151
- };
152
- (async () => {
153
- const {
154
- error: F
155
- } = await U.users.update.baseInfo.post(I);
156
- v.value = !1, F || (W.success("更新成功"), u(), g("submit"));
157
- })();
158
- },
159
- onError(L) {
160
- console.error("上传图片失败"), v.value = !1;
161
- }
162
- });
163
- } catch (L) {
164
- console.error("上传图片失败", L), v.value = !1;
165
- }
166
- }
167
- d.remove();
168
- }), d.click();
169
- };
170
- return (s, d) => (h(), w(e(J), {
171
- ref_key: "formRef",
172
- ref: o,
173
- model: r.value,
174
- "auto-label-width": "",
175
- size: m.size
176
- }, {
177
- default: a(() => [i(e(A), {
178
- field: "avatar",
179
- label: "头像",
180
- rules: [{
181
- required: !1,
182
- message: "请上传头像"
183
- }]
184
- }, {
185
- default: a(() => [i(e(se), {
186
- "image-url": r.value.avatarUrl,
187
- size: 42,
188
- "object-fit": "cover",
189
- "trigger-icon-style": V,
190
- onClick: p
191
- }, {
192
- "trigger-icon": a(() => [i(e(Fe))]),
193
- _: 1
194
- }, 8, ["image-url"])]),
195
- _: 1
196
- }), i(e(A), {
197
- field: "nickname",
198
- label: "昵称",
199
- rules: [{
200
- required: !1,
201
- message: "请输入昵称"
202
- }]
203
- }, {
204
- default: a(() => [i(e(M), {
205
- modelValue: r.value.nickname,
206
- "onUpdate:modelValue": d[0] || (d[0] = (z) => r.value.nickname = z),
207
- placeholder: "请输入昵称"
208
- }, null, 8, ["modelValue"])]),
209
- _: 1
210
- }), i(e(A), {
211
- field: "description",
212
- label: "简介",
213
- rules: [{
214
- required: !1,
215
- message: "请输入描述"
216
- }]
217
- }, {
218
- default: a(() => [i(e($e), {
219
- modelValue: r.value.description,
220
- "onUpdate:modelValue": d[1] || (d[1] = (z) => r.value.description = z),
221
- placeholder: "请输入描述",
222
- "allow-clear": "",
223
- "auto-size": {
224
- minRows: 5
225
- }
226
- }, null, 8, ["modelValue"])]),
227
- _: 1
228
- }), i(e(A), {
229
- field: "",
230
- label: "",
231
- rules: []
232
- }, {
233
- default: a(() => [C("div", De, [i(e(S), {
234
- type: "primary",
235
- loading: t.value,
236
- onClick: n
237
- }, {
238
- default: a(() => [...d[2] || (d[2] = [k(" 提交 ", -1)])]),
239
- _: 1
240
- }, 8, ["loading"])])]),
241
- _: 1
242
- })]),
243
- _: 1
244
- }, 8, ["model", "size"]));
245
- }
246
- }), He = /* @__PURE__ */ H(je, [["__scopeId", "data-v-1d138326"]]), We = /* @__PURE__ */ O({
247
- __name: "AuthkitSendVerifyCode",
248
- props: {
249
- size: {
250
- type: String,
251
- required: !0
252
- },
253
- loading: {
254
- type: Boolean,
255
- required: !0,
256
- default: () => !1
257
- }
258
- },
259
- emits: ["send"],
260
- setup(f, {
261
- expose: l,
262
- emit: g
263
- }) {
264
- const m = g, r = f, v = y(!1);
265
- let o;
266
- const t = y(0), V = $(() => t.value.toString().padStart(2, "0")), u = $(() => t.value > 0), n = () => {
267
- v.value && (t.value <= 0 ? (clearInterval(o), v.value = !1) : t.value--);
268
- };
269
- function p() {
270
- m("send");
271
- }
272
- function s() {
273
- t.value = 60, v.value = !0, o && clearInterval(o), o = setInterval(n, 1e3);
274
- }
275
- return X(() => {
276
- }), l({
277
- startCountFn: s
278
- }), fe(() => {
279
- o && clearInterval(o);
280
- }), (d, z) => (h(), w(e(S), {
281
- class: "OAuthItem",
282
- type: "primary",
283
- size: r.size,
284
- disabled: u.value,
285
- loading: r.loading,
286
- onClick: p
287
- }, {
288
- default: a(() => [z[0] || (z[0] = C("span", null, " 发送验证码", -1)), we(C("span", {
289
- class: "verify-code-timer"
290
- }, T(`(${V.value})`), 513), [[ze, u.value]])]),
291
- _: 1
292
- }, 8, ["size", "disabled", "loading"]));
293
- }
294
- }), ie = /* @__PURE__ */ H(We, [["__scopeId", "data-v-2883dc6d"]]), Ke = {
295
- class: "sendVerifyCodeItem"
296
- }, Ge = {
297
- class: "handle"
298
- }, Ze = /* @__PURE__ */ O({
299
- __name: "AuthkitEmailVerify",
300
- props: {
301
- email: {
302
- type: String,
303
- required: !0,
304
- default: () => ""
305
- },
306
- size: {
307
- type: String,
308
- required: !0
309
- }
310
- },
311
- emits: ["next"],
312
- setup(f, {
313
- emit: l
314
- }) {
315
- const g = l, m = f, r = $(() => me(m.email)), v = y(), o = y(!1), t = y(!1), V = y(), u = y({
316
- userToken: void 0,
317
- emailVerifyId: void 0
318
- });
319
- async function n() {
320
- o.value = !0;
321
- const {
322
- data: s
323
- } = await U.verify.email.retry.post({
324
- email: m.email,
325
- purpose: "bindEmail"
326
- });
327
- o.value = !1, s && (u.value.emailVerifyId = s.emailVerifyId, v.value.startCountFn());
328
- }
329
- async function p() {
330
- if (!await V.value.validate(["userToken"])) {
331
- t.value = !0;
332
- const {
333
- error: d
334
- } = await U.verify.email.post({
335
- email: m.email,
336
- userToken: u.value.userToken,
337
- emailVerifyId: u.value.emailVerifyId,
338
- purpose: "bindEmail"
339
- });
340
- t.value = !1, d || g("next");
341
- }
342
- }
343
- return (s, d) => (h(), w(e(J), {
344
- ref_key: "formRef",
345
- ref: V,
346
- model: u.value,
347
- "auto-label-width": "",
348
- size: m.size
349
- }, {
350
- default: a(() => [i(e(A), {
351
- field: "email",
352
- label: "邮箱",
353
- rules: [{
354
- required: !1,
355
- message: "请输入邮箱"
356
- }, {
357
- type: "email",
358
- message: "请输入有效的邮箱"
359
- }]
360
- }, {
361
- default: a(() => [k(T(r.value), 1)]),
362
- _: 1
363
- }), i(e(A), {
364
- field: "userToken",
365
- label: "验证码",
366
- "hide-label": "",
367
- rules: [{
368
- required: !0,
369
- message: "请输入验证码"
370
- }]
371
- }, {
372
- default: a(() => [C("div", Ke, [i(e(M), {
373
- modelValue: u.value.userToken,
374
- "onUpdate:modelValue": d[0] || (d[0] = (z) => u.value.userToken = z),
375
- placeholder: "请输入验证码"
376
- }, null, 8, ["modelValue"]), i(ie, {
377
- ref_key: "SendVerifyCodeRef",
378
- ref: v,
379
- size: m.size,
380
- loading: o.value,
381
- style: {
382
- "margin-left": "10px"
383
- },
384
- onSend: n
385
- }, null, 8, ["size", "loading"])])]),
386
- _: 1
387
- }), i(e(A), {
388
- field: "",
389
- label: "",
390
- rules: []
391
- }, {
392
- default: a(() => [C("div", Ge, [i(e(S), {
393
- loading: t.value,
394
- type: "primary",
395
- onClick: p
396
- }, {
397
- default: a(() => [...d[1] || (d[1] = [k(" 提交 ", -1)])]),
398
- _: 1
399
- }, 8, ["loading"])])]),
400
- _: 1
401
- })]),
402
- _: 1
403
- }, 8, ["model", "size"]));
404
- }
405
- }), re = /* @__PURE__ */ H(Ze, [["__scopeId", "data-v-f4247d73"]]), Je = {
406
- class: "sendVerifyCodeItem"
407
- }, Qe = {
408
- class: "handle"
409
- }, Xe = /* @__PURE__ */ O({
410
- __name: "AuthkitPhoneVerify",
411
- props: {
412
- phone: {
413
- type: String,
414
- required: !0
415
- },
416
- size: {
417
- type: String,
418
- required: !0
419
- }
420
- },
421
- emits: ["next"],
422
- setup(f, {
423
- emit: l
424
- }) {
425
- const g = l, m = f, r = y(), v = y(!1), o = y(!1), t = y(), V = y({
426
- code: void 0
427
- }), u = $(() => {
428
- const s = m.phone.trim();
429
- return s.length < 7 ? s : `${s.slice(0, 3)}****${s.slice(-4)}`;
430
- });
431
- async function n() {
432
- v.value = !0;
433
- const {
434
- error: s
435
- } = await U.verify.sms.send.post({
436
- phone: m.phone,
437
- purpose: "resetPassword"
438
- });
439
- v.value = !1, s || r.value.startCountFn();
440
- }
441
- async function p() {
442
- if (!await t.value.validate(["code"])) {
443
- o.value = !0;
444
- const {
445
- error: d
446
- } = await U.verify.sms.verify.post({
447
- phone: m.phone,
448
- code: V.value.code,
449
- purpose: "resetPassword"
450
- });
451
- o.value = !1, d || g("next");
452
- }
453
- }
454
- return (s, d) => (h(), w(e(J), {
455
- ref_key: "formRef",
456
- ref: t,
457
- model: V.value,
458
- "auto-label-width": "",
459
- size: m.size
460
- }, {
461
- default: a(() => [i(e(A), {
462
- field: "phone",
463
- label: "手机号"
464
- }, {
465
- default: a(() => [k(T(u.value), 1)]),
466
- _: 1
467
- }), i(e(A), {
468
- field: "code",
469
- label: "验证码",
470
- "hide-label": "",
471
- rules: [{
472
- required: !0,
473
- message: "请输入验证码"
474
- }]
475
- }, {
476
- default: a(() => [C("div", Je, [i(e(M), {
477
- modelValue: V.value.code,
478
- "onUpdate:modelValue": d[0] || (d[0] = (z) => V.value.code = z),
479
- placeholder: "请输入验证码"
480
- }, null, 8, ["modelValue"]), i(ie, {
481
- ref_key: "sendVerifyCodeRef",
482
- ref: r,
483
- size: m.size,
484
- loading: v.value,
485
- style: {
486
- "margin-left": "10px"
487
- },
488
- onSend: n
489
- }, null, 8, ["size", "loading"])])]),
490
- _: 1
491
- }), i(e(A), {
492
- field: "",
493
- label: "",
494
- rules: []
495
- }, {
496
- default: a(() => [C("div", Qe, [i(e(S), {
497
- loading: o.value,
498
- type: "primary",
499
- onClick: p
500
- }, {
501
- default: a(() => [...d[1] || (d[1] = [k("提交", -1)])]),
502
- _: 1
503
- }, 8, ["loading"])])]),
504
- _: 1
505
- })]),
506
- _: 1
507
- }, 8, ["model", "size"]));
508
- }
509
- }), ve = /* @__PURE__ */ H(Xe, [["__scopeId", "data-v-2a868807"]]), Ye = {
510
- class: "handle"
511
- }, et = /* @__PURE__ */ O({
512
- __name: "AuthkitPasswordUpdate",
513
- props: {
514
- size: {
515
- type: String,
516
- required: !0
517
- }
518
- },
519
- emits: ["submit"],
520
- setup(f, {
521
- emit: l
522
- }) {
523
- const g = l, m = y(!1), r = y(), v = f, o = y({
524
- oldPassword: "",
525
- password: "",
526
- confirmPassword: ""
527
- });
528
- async function t() {
529
- if (!await r.value.validate()) {
530
- m.value = !0;
531
- const u = {
532
- password: o.value.password
533
- }, {
534
- error: n
535
- } = await U.users.update.password.post(u);
536
- m.value = !1, n || g("submit", u);
537
- }
538
- }
539
- return (V, u) => (h(), w(e(J), {
540
- ref_key: "formRef",
541
- ref: r,
542
- model: o.value,
543
- "auto-label-width": "",
544
- size: v.size
545
- }, {
546
- default: a(() => [i(e(A), {
547
- field: "oldPassword",
548
- label: "当前密码",
549
- "hide-label": "",
550
- rules: [{
551
- required: !0,
552
- message: "请输入当前密码"
553
- }]
554
- }, {
555
- default: a(() => [i(e(M), {
556
- modelValue: o.value.oldPassword,
557
- "onUpdate:modelValue": u[0] || (u[0] = (n) => o.value.oldPassword = n),
558
- placeholder: "请输入当前密码",
559
- type: "password"
560
- }, null, 8, ["modelValue"])]),
561
- _: 1
562
- }), i(e(A), {
563
- field: "password",
564
- label: "新密码",
565
- "hide-label": "",
566
- rules: [{
567
- required: !0,
568
- message: "新密码请输入"
569
- }, {
570
- minLength: 10,
571
- message: "新密码不能少于10字符"
572
- }]
573
- }, {
574
- default: a(() => [i(e(M), {
575
- modelValue: o.value.password,
576
- "onUpdate:modelValue": u[1] || (u[1] = (n) => o.value.password = n),
577
- placeholder: "请输入新密码",
578
- type: "password"
579
- }, null, 8, ["modelValue"])]),
580
- _: 1
581
- }), i(e(A), {
582
- field: "confirmPassword",
583
- label: "确认密码",
584
- "hide-label": "",
585
- rules: [{
586
- required: !0,
587
- message: "请输入确认密码"
588
- }, {
589
- minLength: 10,
590
- message: "确认密码不能少于10字符"
591
- }, {
592
- validator: (n, p) => {
593
- n !== o.value.password ? p("两次密码输入不一致,请重新输入") : p();
594
- }
595
- }]
596
- }, {
597
- default: a(() => [i(e(M), {
598
- modelValue: o.value.confirmPassword,
599
- "onUpdate:modelValue": u[2] || (u[2] = (n) => o.value.confirmPassword = n),
600
- placeholder: "请输入确认密码密码",
601
- type: "password"
602
- }, null, 8, ["modelValue"])]),
603
- _: 1
604
- }, 8, ["rules"]), i(e(A), {
605
- field: "",
606
- label: "",
607
- rules: []
608
- }, {
609
- default: a(() => [C("div", Ye, [i(e(S), {
610
- type: "primary",
611
- loading: m.value,
612
- onClick: t
613
- }, {
614
- default: a(() => [...u[3] || (u[3] = [k(" 提交 ", -1)])]),
615
- _: 1
616
- }, 8, ["loading"])])]),
617
- _: 1
618
- })]),
619
- _: 1
620
- }, 8, ["model", "size"]));
621
- }
622
- }), tt = /* @__PURE__ */ H(et, [["__scopeId", "data-v-f8bd086f"]]), at = /* @__PURE__ */ O({
623
- __name: "AuthkitSetPassword",
624
- props: {
625
- size: {
626
- type: String,
627
- required: !0
628
- }
629
- },
630
- setup(f) {
631
- const {
632
- userProfile: l,
633
- loading: g,
634
- fetchUserProfile: m,
635
- isLoggedIn: r
636
- } = te(), v = y("hidden"), o = f;
637
- function t(n) {
638
- v.value = n;
639
- }
640
- function V(n) {
641
- W.success("密码修改成功"), v.value = "hidden", m();
642
- }
643
- function u() {
644
- v.value = "update";
645
- }
646
- return X(() => {
647
- r.value && !l.value && m();
648
- }), (n, p) => {
649
- var s, d, z, E, x, N, L, K;
650
- return h(), j(Z, null, [!((s = e(l)) != null && s.email) && !((d = e(l)) != null && d.phone) ? (h(), w(e(D), {
651
- key: 0,
652
- title: "先绑定账号"
653
- }, {
654
- action: a(() => [i(e(S), {
655
- size: o.size,
656
- type: "primary",
657
- onClick: p[0] || (p[0] = (_) => t("update"))
658
- }, {
659
- default: a(() => [...p[2] || (p[2] = [k(" 去绑定邮箱 ", -1)])]),
660
- _: 1
661
- }, 8, ["size"])]),
662
- default: a(() => [p[3] || (p[3] = k(" 请先绑定邮箱或手机号,再设置登录密码。 ", -1))]),
663
- _: 1
664
- })) : P("", !0), ((z = e(l)) != null && z.email || (E = e(l)) != null && E.phone) && v.value === "hidden" ? (h(), w(e(D), {
665
- key: 1,
666
- title: "更改密码"
667
- }, {
668
- action: a(() => [i(e(S), {
669
- size: o.size,
670
- type: "primary",
671
- onClick: p[1] || (p[1] = (_) => t("verify"))
672
- }, {
673
- default: a(() => [...p[4] || (p[4] = [k("更改密码", -1)])]),
674
- _: 1
675
- }, 8, ["size"])]),
676
- default: a(() => [p[5] || (p[5] = k(" 为了账户安全,修改密码前会先验证身份。 ", -1))]),
677
- _: 1
678
- })) : P("", !0), v.value === "update" ? (h(), w(tt, {
679
- key: 2,
680
- size: o.size,
681
- loading: e(g),
682
- onSubmit: V
683
- }, null, 8, ["size", "loading"])) : P("", !0), v.value === "verify" && ((x = e(l)) != null && x.email) ? (h(), w(re, {
684
- key: 3,
685
- size: o.size,
686
- email: (N = e(l)) == null ? void 0 : N.email,
687
- onNext: u
688
- }, null, 8, ["size", "email"])) : P("", !0), v.value === "verify" && !((L = e(l)) != null && L.email) && ((K = e(l)) != null && K.phone) ? (h(), w(ve, {
689
- key: 4,
690
- size: o.size,
691
- phone: e(l).phone,
692
- onNext: u
693
- }, null, 8, ["size", "phone"])) : P("", !0)], 64);
694
- };
695
- }
696
- });
697
- function ge() {
698
- var l;
699
- return typeof window > "u" ? "" : ((l = new URLSearchParams(window.location.search).get("inviteCode")) == null ? void 0 : l.trim()) || "";
700
- }
701
- const lt = {
702
- class: "content"
703
- }, it = {
704
- class: "sendVerifyCodeItem"
705
- }, ot = {
706
- class: "handle"
707
- }, nt = /* @__PURE__ */ O({
708
- __name: "AuthkitEmailUpdate",
709
- props: {
710
- size: {
711
- type: String,
712
- required: !0
713
- },
714
- loading: {
715
- type: Boolean,
716
- required: !0,
717
- default: () => !0
718
- },
719
- purpose: {
720
- type: String,
721
- default: "signUp"
722
- }
723
- },
724
- emits: ["submit"],
725
- setup(f, {
726
- emit: l
727
- }) {
728
- const g = l, m = f, r = y(), v = y(!1), o = y(), t = y({
729
- email: void 0,
730
- userToken: void 0,
731
- emailVerifyId: void 0,
732
- password: void 0,
733
- confirmPassword: void 0,
734
- inviteCode: void 0
735
- });
736
- X(() => {
737
- const n = ge();
738
- n && (t.value.inviteCode = n);
739
- });
740
- async function V() {
741
- if (!await o.value.validateField(["email"])) {
742
- v.value = !0;
743
- const {
744
- data: p
745
- } = await U.verify.email.retry.post({
746
- email: t.value.email,
747
- purpose: m.purpose
748
- });
749
- v.value = !1, p && (t.value.emailVerifyId = p.emailVerifyId, r.value.startCountFn());
750
- }
751
- }
752
- async function u() {
753
- o.value.validate().then((n) => {
754
- n || g("submit", t.value);
755
- });
756
- }
757
- return (n, p) => (h(), j("div", lt, [i(e(J), {
758
- ref_key: "formRef",
759
- ref: o,
760
- model: t.value,
761
- size: m.size,
762
- "auto-label-width": ""
763
- }, {
764
- default: a(() => [i(e(A), {
765
- field: "email",
766
- label: "邮箱",
767
- "hide-label": "",
768
- rules: [{
769
- required: !0,
770
- message: "请输入邮箱"
771
- }, {
772
- type: "email",
773
- message: "请输入有效的邮箱"
774
- }]
775
- }, {
776
- default: a(() => [i(e(M), {
777
- modelValue: t.value.email,
778
- "onUpdate:modelValue": p[0] || (p[0] = (s) => t.value.email = s),
779
- placeholder: "请输入邮箱",
780
- autocomplete: "email username",
781
- type: "email"
782
- }, null, 8, ["modelValue"])]),
783
- _: 1
784
- }), i(e(A), {
785
- field: "userToken",
786
- label: "验证码",
787
- "hide-label": "",
788
- rules: [{
789
- required: !0,
790
- message: "请输入验证码"
791
- }]
792
- }, {
793
- default: a(() => [C("div", it, [i(e(M), {
794
- modelValue: t.value.userToken,
795
- "onUpdate:modelValue": p[1] || (p[1] = (s) => t.value.userToken = s),
796
- placeholder: "请输入验证码",
797
- autocomplete: "one-time-code"
798
- }, null, 8, ["modelValue"]), i(ie, {
799
- ref_key: "SendVerifyCodeRef",
800
- ref: r,
801
- size: m.size,
802
- loading: v.value,
803
- style: {
804
- "margin-left": "10px"
805
- },
806
- onSend: V
807
- }, null, 8, ["size", "loading"])])]),
808
- _: 1
809
- }), i(e(A), {
810
- field: "password",
811
- label: "密码",
812
- "hide-label": "",
813
- rules: [{
814
- required: !0,
815
- message: "密码请输入"
816
- }, {
817
- minLength: 10,
818
- message: "密码不能少于10字符"
819
- }]
820
- }, {
821
- default: a(() => [i(e(M), {
822
- modelValue: t.value.password,
823
- "onUpdate:modelValue": p[2] || (p[2] = (s) => t.value.password = s),
824
- placeholder: "请输入密码",
825
- type: "password",
826
- autocomplete: "new-password"
827
- }, null, 8, ["modelValue"])]),
828
- _: 1
829
- }), i(e(A), {
830
- field: "confirmPassword",
831
- label: "确认密码",
832
- "hide-label": "",
833
- rules: [{
834
- required: !0,
835
- message: "请输入确认密码"
836
- }, {
837
- minLength: 10,
838
- message: "确认密码不能少于10字符"
839
- }, {
840
- validator: (s, d) => {
841
- s !== t.value.password ? d("两次密码输入不一致,请重新输入") : d();
842
- }
843
- }]
844
- }, {
845
- default: a(() => [i(e(M), {
846
- modelValue: t.value.confirmPassword,
847
- "onUpdate:modelValue": p[3] || (p[3] = (s) => t.value.confirmPassword = s),
848
- placeholder: "请输入确认密码密码",
849
- type: "password",
850
- autocomplete: "new-password"
851
- }, null, 8, ["modelValue"])]),
852
- _: 1
853
- }, 8, ["rules"]), i(e(A), {
854
- field: "inviteCode",
855
- label: "邀请码",
856
- "hide-label": "",
857
- rules: [{
858
- required: !1
859
- }]
860
- }, {
861
- default: a(() => [i(e(M), {
862
- modelValue: t.value.inviteCode,
863
- "onUpdate:modelValue": p[4] || (p[4] = (s) => t.value.inviteCode = s),
864
- placeholder: "邀请码(可选)",
865
- autocomplete: "off"
866
- }, null, 8, ["modelValue"])]),
867
- _: 1
868
- }), C("div", ot, [i(e(S), {
869
- type: "primary",
870
- loading: m.loading,
871
- long: "",
872
- size: m.size,
873
- onClick: u
874
- }, {
875
- default: a(() => [...p[5] || (p[5] = [k(" 提交 ", -1)])]),
876
- _: 1
877
- }, 8, ["loading", "size"])])]),
878
- _: 1
879
- }, 8, ["model", "size"])]));
880
- }
881
- }), st = /* @__PURE__ */ H(nt, [["__scopeId", "data-v-5bae4769"]]), rt = /* @__PURE__ */ O({
882
- __name: "AuthkitEmailBinding",
883
- props: {
884
- size: {
885
- type: String,
886
- required: !0
887
- }
888
- },
889
- setup(f) {
890
- const {
891
- userProfile: l,
892
- loading: g,
893
- fetchUserProfile: m
894
- } = te(), r = y("hidden"), v = f;
895
- function o(u) {
896
- r.value = u;
897
- }
898
- async function t(u) {
899
- g.value = !0;
900
- const n = {
901
- email: u.email,
902
- userToken: u.userToken,
903
- emailVerifyId: u.emailVerifyId,
904
- password: u.password || ""
905
- // API 要求 password,但绑定邮箱时可能不需要,传空字符串
906
- }, {
907
- error: p
908
- } = await U.users.update.email.post(n);
909
- g.value = !1, p || (W.success("绑定成功"), r.value = "hidden", m());
910
- }
911
- function V() {
912
- r.value = "update";
913
- }
914
- return X(() => {
915
- l.value || m();
916
- }), (u, n) => {
917
- var p, s, d;
918
- return h(), j(Z, null, [!((p = e(l)) != null && p.email) && r.value === "hidden" ? (h(), w(e(D), {
919
- key: 0,
920
- title: "绑定邮箱"
921
- }, {
922
- action: a(() => [i(e(S), {
923
- size: v.size,
924
- type: "primary",
925
- onClick: n[0] || (n[0] = (z) => o("update"))
926
- }, {
927
- default: a(() => [...n[2] || (n[2] = [k(" 绑定邮箱 ", -1)])]),
928
- _: 1
929
- }, 8, ["size"])]),
930
- default: a(() => [n[3] || (n[3] = k(" 您还未绑定邮箱,请点击绑定邮箱 ", -1))]),
931
- _: 1
932
- })) : P("", !0), (s = e(l)) != null && s.email && r.value === "hidden" ? (h(), w(e(D), {
933
- key: 1,
934
- title: "更改邮箱"
935
- }, {
936
- action: a(() => [i(e(S), {
937
- size: v.size,
938
- type: "primary",
939
- onClick: n[1] || (n[1] = (z) => o("verify"))
940
- }, {
941
- default: a(() => [...n[4] || (n[4] = [k(" 更改邮箱 ", -1)])]),
942
- _: 1
943
- }, 8, ["size"])]),
944
- default: a(() => {
945
- var z;
946
- return [k(T(`您绑定的邮箱为${e(me)((z = e(l)) == null ? void 0 : z.email)}`) + " ", 1)];
947
- }),
948
- _: 1
949
- })) : P("", !0), r.value === "update" ? (h(), w(st, {
950
- key: 2,
951
- loading: e(g),
952
- size: v.size,
953
- purpose: "bindEmail",
954
- onSubmit: t
955
- }, null, 8, ["loading", "size"])) : P("", !0), r.value === "verify" ? (h(), w(re, {
956
- key: 3,
957
- size: v.size,
958
- email: (d = e(l)) == null ? void 0 : d.email,
959
- onNext: V
960
- }, null, 8, ["size", "email"])) : P("", !0)], 64);
961
- };
962
- }
963
- }), ut = /* @__PURE__ */ H(rt, [["__scopeId", "data-v-98ebf261"]]), dt = {
964
- class: "BindPhone"
965
- }, ct = {
966
- class: "header"
967
- }, ft = {
968
- class: "title"
969
- }, mt = {
970
- class: "subtitle"
971
- }, pt = {
972
- class: "content"
973
- }, vt = {
974
- class: "sendVerifyCodeItem"
975
- }, gt = {
976
- class: "handle"
977
- }, ht = {
978
- key: 0,
979
- class: "skip"
980
- }, yt = /* @__PURE__ */ O({
981
- __name: "AuthkitBindPhone",
982
- props: {
983
- size: {
984
- type: String,
985
- required: !0
986
- },
987
- loading: {
988
- type: Boolean,
989
- required: !0,
990
- default: () => !1
991
- },
992
- showSkip: {
993
- type: Boolean,
994
- default: !1
995
- },
996
- title: {
997
- type: String,
998
- default: "绑定手机号"
999
- },
1000
- subtitle: {
1001
- type: String,
1002
- default: "请绑定手机号以完成账号设置"
1003
- },
1004
- submitText: {
1005
- type: String,
1006
- default: "绑定手机号"
1007
- }
1008
- },
1009
- emits: ["submit", "skip"],
1010
- setup(f, {
1011
- emit: l
1012
- }) {
1013
- const g = l, m = f, r = y(), v = y(!1), o = y(), t = y({
1014
- phone: void 0,
1015
- code: void 0
1016
- });
1017
- async function V() {
1018
- if (!await o.value.validateField(["phone"])) {
1019
- v.value = !0;
1020
- const {
1021
- error: s
1022
- } = await U.verify.sms.send.post({
1023
- phone: t.value.phone,
1024
- purpose: "bindPhone"
1025
- });
1026
- v.value = !1, s || r.value.startCountFn();
1027
- }
1028
- }
1029
- async function u() {
1030
- o.value.validate().then((p) => {
1031
- p || g("submit", {
1032
- phone: t.value.phone,
1033
- code: t.value.code
1034
- });
1035
- });
1036
- }
1037
- function n() {
1038
- g("skip");
1039
- }
1040
- return (p, s) => (h(), j("div", dt, [C("div", ct, [C("h3", ft, T(m.title), 1), C("p", mt, T(m.subtitle), 1)]), C("div", pt, [i(e(J), {
1041
- ref_key: "formRef",
1042
- ref: o,
1043
- model: t.value,
1044
- size: m.size,
1045
- "auto-label-width": ""
1046
- }, {
1047
- default: a(() => [i(e(A), {
1048
- field: "phone",
1049
- label: "手机号",
1050
- "hide-label": "",
1051
- rules: [{
1052
- required: !0,
1053
- message: "请输入手机号"
1054
- }, {
1055
- match: /^1[3-9]\d{9}$/,
1056
- message: "请输入有效的手机号"
1057
- }]
1058
- }, {
1059
- default: a(() => [i(e(M), {
1060
- modelValue: t.value.phone,
1061
- "onUpdate:modelValue": s[0] || (s[0] = (d) => t.value.phone = d),
1062
- placeholder: "请输入手机号",
1063
- autocomplete: "tel",
1064
- type: "tel"
1065
- }, null, 8, ["modelValue"])]),
1066
- _: 1
1067
- }), i(e(A), {
1068
- field: "code",
1069
- label: "验证码",
1070
- "hide-label": "",
1071
- rules: [{
1072
- required: !0,
1073
- message: "请输入验证码"
1074
- }]
1075
- }, {
1076
- default: a(() => [C("div", vt, [i(e(M), {
1077
- modelValue: t.value.code,
1078
- "onUpdate:modelValue": s[1] || (s[1] = (d) => t.value.code = d),
1079
- placeholder: "请输入验证码",
1080
- autocomplete: "one-time-code"
1081
- }, null, 8, ["modelValue"]), i(ie, {
1082
- ref_key: "SendVerifyCodeRef",
1083
- ref: r,
1084
- size: m.size,
1085
- loading: v.value,
1086
- style: {
1087
- "margin-left": "10px"
1088
- },
1089
- onSend: V
1090
- }, null, 8, ["size", "loading"])])]),
1091
- _: 1
1092
- }), C("div", gt, [i(e(S), {
1093
- type: "primary",
1094
- loading: m.loading,
1095
- long: "",
1096
- size: m.size,
1097
- onClick: u
1098
- }, {
1099
- default: a(() => [k(T(m.submitText), 1)]),
1100
- _: 1
1101
- }, 8, ["loading", "size"])])]),
1102
- _: 1
1103
- }, 8, ["model", "size"])]), m.showSkip ? (h(), j("div", ht, [i(e(Ie), {
1104
- onClick: n
1105
- }, {
1106
- default: a(() => [...s[2] || (s[2] = [k("稍后绑定", -1)])]),
1107
- _: 1
1108
- })])) : P("", !0)]));
1109
- }
1110
- }), bt = /* @__PURE__ */ H(yt, [["__scopeId", "data-v-bb70264d"]]), kt = /* @__PURE__ */ O({
1111
- __name: "AuthkitPhoneBinding",
1112
- props: {
1113
- size: {
1114
- type: String,
1115
- required: !0
1116
- }
1117
- },
1118
- setup(f) {
1119
- const {
1120
- userProfile: l,
1121
- loading: g,
1122
- fetchUserProfile: m
1123
- } = te(), r = y("hidden"), v = f, o = $(() => {
1124
- var n;
1125
- const u = ((n = l.value) == null ? void 0 : n.phone) || "";
1126
- return u.length < 7 ? u : `${u.slice(0, 3)}****${u.slice(-4)}`;
1127
- });
1128
- function t(u) {
1129
- r.value = u;
1130
- }
1131
- async function V(u) {
1132
- var s, d;
1133
- g.value = !0;
1134
- const n = (s = l.value) != null && s.phone ? U.users.update.myPhone.post({
1135
- phone: u.phone,
1136
- code: u.code
1137
- }) : U.auth.bind.phone.post({
1138
- phone: u.phone,
1139
- code: u.code
1140
- }), {
1141
- error: p
1142
- } = await n;
1143
- g.value = !1, p || (W.success((d = l.value) != null && d.phone ? "更改成功" : "绑定成功"), r.value = "hidden", m());
1144
- }
1145
- return X(() => {
1146
- l.value || m();
1147
- }), (u, n) => {
1148
- var p, s, d, z, E;
1149
- return h(), j(Z, null, [!((p = e(l)) != null && p.phone) && r.value === "hidden" ? (h(), w(e(D), {
1150
- key: 0,
1151
- title: "绑定手机号"
1152
- }, {
1153
- action: a(() => [i(e(S), {
1154
- size: v.size,
1155
- type: "primary",
1156
- onClick: n[0] || (n[0] = (x) => t("update"))
1157
- }, {
1158
- default: a(() => [...n[2] || (n[2] = [k("绑定手机号", -1)])]),
1159
- _: 1
1160
- }, 8, ["size"])]),
1161
- default: a(() => [n[3] || (n[3] = k(" 您还未绑定手机号,请点击绑定手机号。 ", -1))]),
1162
- _: 1
1163
- })) : P("", !0), (s = e(l)) != null && s.phone && r.value === "hidden" ? (h(), w(e(D), {
1164
- key: 1,
1165
- title: "已绑定手机号"
1166
- }, {
1167
- action: a(() => [i(e(S), {
1168
- size: v.size,
1169
- type: "primary",
1170
- onClick: n[1] || (n[1] = (x) => t("update"))
1171
- }, {
1172
- default: a(() => [...n[4] || (n[4] = [k("更改手机号", -1)])]),
1173
- _: 1
1174
- }, 8, ["size"])]),
1175
- default: a(() => [k(T(`您绑定的手机号为 ${o.value}`) + " ", 1)]),
1176
- _: 1
1177
- })) : P("", !0), r.value === "update" ? (h(), w(bt, {
1178
- key: 2,
1179
- loading: e(g),
1180
- size: v.size,
1181
- title: (d = e(l)) != null && d.phone ? "更改手机号" : "绑定手机号",
1182
- subtitle: (z = e(l)) != null && z.phone ? "请输入新的手机号并完成短信验证" : "请绑定手机号以完成账号设置",
1183
- "submit-text": (E = e(l)) != null && E.phone ? "更改手机号" : "绑定手机号",
1184
- onSubmit: V
1185
- }, null, 8, ["loading", "size", "title", "subtitle", "submit-text"])) : P("", !0)], 64);
1186
- };
1187
- }
1188
- });
1189
- function he() {
1190
- return ee.oauthCallbackUrl ? ee.oauthCallbackUrl : `${window.location.origin}/`;
1191
- }
1192
- function _t() {
1193
- const f = window.location.pathname + window.location.search + window.location.hash, l = new URLSearchParams(window.location.search);
1194
- !l.has("token") && !l.has("error") && !l.has("bindSuccess") && sessionStorage.setItem("auth_redirect", f);
1195
- }
1196
- async function ae(f, l) {
1197
- const g = ee.appId;
1198
- if (!g) {
1199
- console.error(`${f} OAuth 失败: appId 未配置`);
1200
- return;
1201
- }
1202
- const m = he(), r = (l == null ? void 0 : l.inviteCode) || ge() || void 0, v = {
1203
- appId: g,
1204
- inviteCode: r,
1205
- redirectUri: m
1206
- };
1207
- _t();
1208
- const o = {
1209
- github: () => U.oauth.github.login.get(v),
1210
- google: () => U.oauth.google.login.get(v),
1211
- microsoft: () => U.oauth.microsoft.login.get(v),
1212
- wechat: () => U.oauth.wechat.login.get(v)
1213
- };
1214
- try {
1215
- const {
1216
- data: t
1217
- } = await o[f]();
1218
- t != null && t.redirectUri ? window.location.href = t.redirectUri : console.error(`${f} OAuth 重定向URL为空`);
1219
- } catch (t) {
1220
- console.error(`${f} OAuth 授权失败:`, t);
1221
- }
1222
- }
1223
- function wt(f) {
1224
- ae("github", {
1225
- inviteCode: f
1226
- });
1227
- }
1228
- function zt(f) {
1229
- ae("google", {
1230
- inviteCode: f
1231
- });
1232
- }
1233
- function Vt(f) {
1234
- ae("microsoft", {
1235
- inviteCode: f
1236
- });
1237
- }
1238
- function Ct(f) {
1239
- ae("wechat", {
1240
- inviteCode: f
1241
- });
1242
- }
1243
- function $t() {
1244
- return {
1245
- githubAuth: wt,
1246
- googleAuth: zt,
1247
- microsoftAuth: Vt,
1248
- wechatAuth: Ct,
1249
- startOauth: ae,
1250
- getOauthCallbackUrl: he
1251
- };
1252
- }
1253
- const It = {
1254
- class: "oauth-binding-account"
1255
- }, Pt = {
1256
- class: "oauth-binding-account__info"
1257
- }, St = {
1258
- class: "oauth-binding-account__provider"
1259
- }, At = {
1260
- class: "oauth-binding-account__name"
1261
- }, Ut = {
1262
- class: "oauth-binding-verify-actions"
1263
- }, xt = /* @__PURE__ */ O({
1264
- __name: "AuthkitOAuthBinding",
1265
- props: {
1266
- provider: {
1267
- type: String,
1268
- required: !0
1269
- },
1270
- label: {
1271
- type: String,
1272
- required: !0
1273
- },
1274
- size: {
1275
- type: String,
1276
- required: !0
1277
- }
1278
- },
1279
- setup(f) {
1280
- const l = f, {
1281
- userProfile: g,
1282
- fetchUserProfile: m
1283
- } = te(), {
1284
- appsData: r
1285
- } = pe(), {
1286
- getOauthCallbackUrl: v
1287
- } = $t(), o = y("hidden"), t = y(), V = y(!1);
1288
- let u;
1289
- const n = $(() => {
1290
- var c;
1291
- return ((c = g.value) == null ? void 0 : c[l.provider]) || null;
1292
- }), p = $(() => {
1293
- const c = n.value;
1294
- return c ? c.login || c.name || c.nickname || c.displayName || c.userPrincipalName || c.email || c.mail || c.openid || l.label : "";
1295
- }), s = $(() => {
1296
- const c = n.value;
1297
- return (c == null ? void 0 : c.avatar_url) || (c == null ? void 0 : c.picture) || (c == null ? void 0 : c.headimgurl) || "";
1298
- }), d = $(() => ({
1299
- github: "bi:github",
1300
- google: "flat-color-icons:google",
1301
- microsoft: "logos:microsoft-icon",
1302
- wechat: "ri:wechat-fill"
1303
- })[l.provider]), z = $(() => {
1304
- const c = r.value.authMethods;
1305
- return c.signUp.email || c.login.emailPassword || c.login.emailCode;
1306
- }), E = $(() => {
1307
- const c = r.value.authMethods;
1308
- return c.signUp.phone || c.login.phonePassword || c.login.phoneCode;
1309
- }), x = $(() => {
1310
- var c;
1311
- return z.value && !!((c = g.value) != null && c.email);
1312
- }), N = $(() => {
1313
- var c;
1314
- return E.value && !!((c = g.value) != null && c.phone);
1315
- }), L = $(() => {
1316
- const c = [];
1317
- return x.value && c.push("email"), N.value && c.push("phone"), c;
1318
- }), K = $(() => z.value || E.value), _ = $(() => o.value !== "hidden" && L.value.length > 1 && !t.value), I = $(() => {
1319
- var c;
1320
- return o.value !== "hidden" && t.value === "email" && !!((c = g.value) != null && c.email);
1321
- }), F = $(() => {
1322
- var c;
1323
- return o.value !== "hidden" && t.value === "phone" && !!((c = g.value) != null && c.phone);
1324
- }), Q = $(() => o.value === "unbind" ? "解绑" : "绑定");
1325
- function R(c) {
1326
- if (c === "hidden") {
1327
- o.value = c, t.value = void 0;
1328
- return;
1329
- }
1330
- if (!K.value) {
1331
- c === "bind" && B(), c === "unbind" && Y();
1332
- return;
1333
- }
1334
- const q = L.value;
1335
- if (q.length === 0) {
1336
- W.error("请先绑定应用已开启的邮箱或手机号后再操作第三方账号");
1337
- return;
1338
- }
1339
- o.value = c, t.value = q.length === 1 ? q[0] : void 0;
1340
- }
1341
- function b(c) {
1342
- t.value = c;
1343
- }
1344
- async function B() {
1345
- const c = ee.appId;
1346
- if (!c) {
1347
- console.error(`${l.label} OAuth 失败: appId 未配置`);
1348
- return;
1349
- }
1350
- const q = v(), le = {
1351
- github: () => U.oauth.github.login.get({
1352
- appId: c,
1353
- mode: "bind",
1354
- redirectUri: q
1355
- }),
1356
- google: () => U.oauth.google.login.get({
1357
- appId: c,
1358
- mode: "bind",
1359
- redirectUri: q
1360
- }),
1361
- microsoft: () => U.oauth.microsoft.login.get({
1362
- appId: c,
1363
- mode: "bind",
1364
- redirectUri: q
1365
- }),
1366
- wechat: () => U.oauth.wechat.login.get({
1367
- appId: c,
1368
- mode: "bind",
1369
- redirectUri: q
1370
- })
1371
- }, {
1372
- data: G
1373
- } = await le[l.provider]();
1374
- G != null && G.redirectUri && (V.value = !0, window.open(G.redirectUri, "_blank"));
1375
- }
1376
- async function Y() {
1377
- const {
1378
- error: c
1379
- } = await U.users.unbind.oauth.post({
1380
- provider: l.provider
1381
- });
1382
- c || (W.success("解绑成功"), o.value = "hidden", m());
1383
- }
1384
- function ue() {
1385
- o.value === "bind" && (o.value = "hidden", B()), o.value === "unbind" && Y();
1386
- }
1387
- function ye() {
1388
- V.value && m();
1389
- }
1390
- return X(() => {
1391
- g.value || m(), u = setInterval(ye, 1e3);
1392
- }), fe(() => {
1393
- u && clearInterval(u);
1394
- }), (c, q) => {
1395
- var le, G;
1396
- return h(), j(Z, null, [!n.value && o.value === "hidden" ? (h(), w(e(D), {
1397
- key: 0,
1398
- title: `绑定${l.label}`
1399
- }, {
1400
- action: a(() => [i(e(S), {
1401
- size: l.size,
1402
- type: "primary",
1403
- onClick: q[0] || (q[0] = (oe) => R("bind"))
1404
- }, {
1405
- default: a(() => [k(" 绑定" + T(l.label), 1)]),
1406
- _: 1
1407
- }, 8, ["size"])]),
1408
- default: a(() => [k(" 您还未绑定" + T(l.label) + "账号,请点击绑定。 ", 1)]),
1409
- _: 1
1410
- }, 8, ["title"])) : P("", !0), n.value && o.value === "hidden" ? (h(), w(e(D), {
1411
- key: 1,
1412
- title: `解绑${l.label}`
1413
- }, {
1414
- action: a(() => [i(e(S), {
1415
- size: l.size,
1416
- type: "primary",
1417
- onClick: q[1] || (q[1] = (oe) => R("unbind"))
1418
- }, {
1419
- default: a(() => [k(" 解绑" + T(l.label), 1)]),
1420
- _: 1
1421
- }, 8, ["size"])]),
1422
- default: a(() => [C("div", It, [s.value ? (h(), w(e(se), {
1423
- key: 0,
1424
- class: "oauth-binding-account__avatar",
1425
- "image-url": s.value,
1426
- size: 42
1427
- }, null, 8, ["image-url"])) : (h(), w(e(se), {
1428
- key: 1,
1429
- class: "oauth-binding-account__avatar oauth-binding-account__avatar--placeholder",
1430
- size: 42
1431
- }, {
1432
- default: a(() => [i(e(Be), {
1433
- icon: d.value,
1434
- width: 22
1435
- }, null, 8, ["icon"])]),
1436
- _: 1
1437
- })), C("div", Pt, [C("div", St, T(l.label), 1), C("div", At, T(p.value), 1)])])]),
1438
- _: 1
1439
- }, 8, ["title"])) : P("", !0), _.value ? (h(), w(e(D), {
1440
- key: 2,
1441
- title: `${Q.value}前验证身份`
1442
- }, {
1443
- action: a(() => [C("div", Ut, [x.value ? (h(), w(e(S), {
1444
- key: 0,
1445
- size: l.size,
1446
- type: "primary",
1447
- onClick: q[2] || (q[2] = (oe) => b("email"))
1448
- }, {
1449
- default: a(() => [...q[4] || (q[4] = [k(" 邮箱验证 ", -1)])]),
1450
- _: 1
1451
- }, 8, ["size"])) : P("", !0), N.value ? (h(), w(e(S), {
1452
- key: 1,
1453
- size: l.size,
1454
- type: "primary",
1455
- onClick: q[3] || (q[3] = (oe) => b("phone"))
1456
- }, {
1457
- default: a(() => [...q[5] || (q[5] = [k(" 手机验证 ", -1)])]),
1458
- _: 1
1459
- }, 8, ["size"])) : P("", !0)])]),
1460
- default: a(() => [q[6] || (q[6] = k(" 请选择一种已绑定的验证方式。 ", -1))]),
1461
- _: 1
1462
- }, 8, ["title"])) : P("", !0), I.value ? (h(), w(re, {
1463
- key: 3,
1464
- size: l.size,
1465
- email: (le = e(g)) == null ? void 0 : le.email,
1466
- onNext: ue
1467
- }, null, 8, ["size", "email"])) : P("", !0), F.value ? (h(), w(ve, {
1468
- key: 4,
1469
- size: l.size,
1470
- phone: ((G = e(g)) == null ? void 0 : G.phone) || "",
1471
- onNext: ue
1472
- }, null, 8, ["size", "phone"])) : P("", !0)], 64);
1473
- };
1474
- }
1475
- }), qt = /* @__PURE__ */ H(xt, [["__scopeId", "data-v-596b697b"]]), Tt = {
1476
- class: "dependency-list"
1477
- }, Bt = {
1478
- class: "label"
1479
- }, Rt = {
1480
- class: "count"
1481
- }, Et = {
1482
- class: "action-bar"
1483
- }, Lt = {
1484
- class: "verify-code-row"
1485
- }, Nt = /* @__PURE__ */ O({
1486
- __name: "AuthkitAccountDelete",
1487
- props: {
1488
- size: {
1489
- type: String,
1490
- required: !0
1491
- }
1492
- },
1493
- emits: ["deleted"],
1494
- setup(f, {
1495
- emit: l
1496
- }) {
1497
- const g = f, m = l, {
1498
- userProfile: r,
1499
- clearUserProfile: v
1500
- } = te(), {
1501
- clearAuth: o
1502
- } = Re(), t = y("check"), V = y(!1), u = y([]), n = y(!1), p = y(""), s = y(0);
1503
- let d = null;
1504
- const z = $(() => {
1505
- var Y;
1506
- const R = ((Y = r.value) == null ? void 0 : Y.email) || "";
1507
- if (!R) return "";
1508
- const [b, B] = R.split("@");
1509
- return b.length <= 2 ? R : `${b.slice(0, 2)}***@${B}`;
1510
- }), E = y(), x = y({
1511
- userToken: "",
1512
- password: "",
1513
- confirmText: ""
1514
- }), N = y(!1);
1515
- function L(R, b) {
1516
- R !== "注销" ? b('请输入"注销"以确认操作') : b();
1517
- }
1518
- async function K() {
1519
- var R;
1520
- if (V.value = !0, V.value = !1, !((R = r.value) != null && R.email)) {
1521
- W.error("账号未绑定邮箱,无法进行注销验证。请先绑定邮箱");
1522
- return;
1523
- }
1524
- t.value = "sendCode";
1525
- }
1526
- async function _() {
1527
- var b;
1528
- if (!((b = r.value) != null && b.email)) {
1529
- W.error("请先绑定邮箱");
1530
- return;
1531
- }
1532
- n.value = !0;
1533
- const {
1534
- data: R
1535
- } = await U.verify.email.retry.post({
1536
- email: r.value.email,
1537
- purpose: "deleteAccount"
1538
- });
1539
- n.value = !1, R && (p.value = R.emailVerifyId, W.success("验证码已发送"), t.value = "confirm", I());
1540
- }
1541
- function I() {
1542
- s.value = 60, d && clearInterval(d), d = setInterval(() => {
1543
- s.value--, s.value <= 0 && d && (clearInterval(d), d = null);
1544
- }, 1e3);
1545
- }
1546
- async function F() {
1547
- var B;
1548
- if (await ((B = E.value) == null ? void 0 : B.validate())) return;
1549
- N.value = !0;
1550
- const {
1551
- error: b
1552
- } = await U.users.deleteAccount.post({
1553
- password: x.value.password,
1554
- userToken: x.value.userToken,
1555
- emailVerifyId: p.value,
1556
- confirmText: x.value.confirmText
1557
- });
1558
- N.value = !1, b || (t.value = "success", v(), o(), m("deleted"));
1559
- }
1560
- function Q() {
1561
- window.location.href = "/";
1562
- }
1563
- return (R, b) => t.value === "check" ? (h(), w(e(D), {
1564
- key: 0,
1565
- type: "warning",
1566
- title: "注销账号"
1567
- }, {
1568
- action: a(() => [i(e(S), {
1569
- size: g.size,
1570
- type: "primary",
1571
- status: "danger",
1572
- loading: V.value,
1573
- onClick: K
1574
- }, {
1575
- default: a(() => [k(T(V.value ? "检查中..." : "开始注销"), 1)]),
1576
- _: 1
1577
- }, 8, ["size", "loading"])]),
1578
- default: a(() => [b[6] || (b[6] = k(" 注销账号后,登录凭据、第三方绑定和当前登录态会被清除;历史订单、用量、审计等业务记录会保留用于对账和安全追溯。 ", -1))]),
1579
- _: 1
1580
- })) : t.value === "dependencies" ? (h(), j(Z, {
1581
- key: 1
1582
- }, [i(e(D), {
1583
- type: "error",
1584
- title: "无法注销账号"
1585
- }, {
1586
- default: a(() => [...b[7] || (b[7] = [k(" 您的账号下还有以下资源,请先处理后再注销: ", -1)])]),
1587
- _: 1
1588
- }), C("div", Tt, [(h(!0), j(Z, null, Ve(u.value, (B) => (h(), j("div", {
1589
- key: B.type,
1590
- class: "dependency-item"
1591
- }, [C("span", Bt, T(B.label), 1), C("span", Rt, T(B.count) + " 个", 1)]))), 128))]), C("div", Et, [i(e(S), {
1592
- size: g.size,
1593
- onClick: b[0] || (b[0] = (B) => t.value = "check")
1594
- }, {
1595
- default: a(() => [...b[8] || (b[8] = [k("返回", -1)])]),
1596
- _: 1
1597
- }, 8, ["size"])])], 64)) : t.value === "sendCode" ? (h(), w(e(D), {
1598
- key: 2,
1599
- type: "normal",
1600
- title: "身份验证"
1601
- }, {
1602
- action: a(() => [i(e(ce), null, {
1603
- default: a(() => [i(e(S), {
1604
- size: g.size,
1605
- onClick: b[1] || (b[1] = (B) => t.value = "check")
1606
- }, {
1607
- default: a(() => [...b[9] || (b[9] = [k("取消", -1)])]),
1608
- _: 1
1609
- }, 8, ["size"]), i(e(S), {
1610
- size: g.size,
1611
- type: "primary",
1612
- loading: n.value,
1613
- onClick: _
1614
- }, {
1615
- default: a(() => [k(T(n.value ? "发送中..." : "发送验证码"), 1)]),
1616
- _: 1
1617
- }, 8, ["size", "loading"])]),
1618
- _: 1
1619
- })]),
1620
- default: a(() => [k(" 为确保账号安全,我们将向您的邮箱 " + T(z.value) + " 发送验证码 ", 1)]),
1621
- _: 1
1622
- })) : t.value === "confirm" ? (h(), j(Z, {
1623
- key: 3
1624
- }, [i(e(D), {
1625
- type: "warning",
1626
- title: "确认注销"
1627
- }, {
1628
- default: a(() => [k(" 验证码已发送至 " + T(z.value) + ",注销后该账号将无法继续登录,请谨慎操作 ", 1)]),
1629
- _: 1
1630
- }), i(e(J), {
1631
- ref_key: "formRef",
1632
- ref: E,
1633
- model: x.value,
1634
- size: g.size,
1635
- class: "confirm-form",
1636
- layout: "vertical"
1637
- }, {
1638
- default: a(() => [i(e(A), {
1639
- field: "userToken",
1640
- label: "邮箱验证码",
1641
- rules: [{
1642
- required: !0,
1643
- message: "请输入验证码"
1644
- }]
1645
- }, {
1646
- default: a(() => [C("div", Lt, [i(e(M), {
1647
- modelValue: x.value.userToken,
1648
- "onUpdate:modelValue": b[2] || (b[2] = (B) => x.value.userToken = B),
1649
- placeholder: "请输入6位验证码",
1650
- "max-length": 6,
1651
- "allow-clear": ""
1652
- }, null, 8, ["modelValue"]), i(e(S), {
1653
- disabled: s.value > 0,
1654
- loading: n.value,
1655
- onClick: _
1656
- }, {
1657
- default: a(() => [k(T(s.value > 0 ? `${s.value}s 后重发` : "重新发送"), 1)]),
1658
- _: 1
1659
- }, 8, ["disabled", "loading"])])]),
1660
- _: 1
1661
- }), i(e(A), {
1662
- field: "password",
1663
- label: "登录密码",
1664
- rules: [{
1665
- required: !0,
1666
- message: "请输入密码"
1667
- }]
1668
- }, {
1669
- default: a(() => [i(e(Pe), {
1670
- modelValue: x.value.password,
1671
- "onUpdate:modelValue": b[3] || (b[3] = (B) => x.value.password = B),
1672
- placeholder: "请输入您的登录密码",
1673
- "allow-clear": ""
1674
- }, null, 8, ["modelValue"])]),
1675
- _: 1
1676
- }), i(e(A), {
1677
- field: "confirmText",
1678
- label: "请输入「注销」以确认",
1679
- rules: [{
1680
- required: !0,
1681
- message: "请输入确认文字"
1682
- }, {
1683
- validator: L
1684
- }]
1685
- }, {
1686
- default: a(() => [i(e(M), {
1687
- modelValue: x.value.confirmText,
1688
- "onUpdate:modelValue": b[4] || (b[4] = (B) => x.value.confirmText = B),
1689
- placeholder: "注销",
1690
- "allow-clear": ""
1691
- }, null, 8, ["modelValue"])]),
1692
- _: 1
1693
- }, 8, ["rules"]), i(e(A), null, {
1694
- default: a(() => [i(e(ce), null, {
1695
- default: a(() => [i(e(S), {
1696
- onClick: b[5] || (b[5] = (B) => t.value = "check")
1697
- }, {
1698
- default: a(() => [...b[10] || (b[10] = [k("取消", -1)])]),
1699
- _: 1
1700
- }), i(e(S), {
1701
- type: "primary",
1702
- status: "danger",
1703
- loading: N.value,
1704
- onClick: F
1705
- }, {
1706
- default: a(() => [k(T(N.value ? "注销中..." : "确认注销"), 1)]),
1707
- _: 1
1708
- }, 8, ["loading"])]),
1709
- _: 1
1710
- })]),
1711
- _: 1
1712
- })]),
1713
- _: 1
1714
- }, 8, ["model", "size"])], 64)) : t.value === "success" ? (h(), w(e(Se), {
1715
- key: 4,
1716
- status: "success",
1717
- title: "账号已注销"
1718
- }, {
1719
- subtitle: a(() => [...b[11] || (b[11] = [k(" 您的账号已成功注销,登录凭据和绑定身份已清除 ", -1)])]),
1720
- extra: a(() => [i(e(S), {
1721
- type: "primary",
1722
- onClick: Q
1723
- }, {
1724
- default: a(() => [...b[12] || (b[12] = [k("返回首页", -1)])]),
1725
- _: 1
1726
- })]),
1727
- _: 1
1728
- })) : P("", !0);
1729
- }
1730
- }), Mt = /* @__PURE__ */ H(Nt, [["__scopeId", "data-v-da2ecd73"]]), Ot = {
1731
- class: "content"
1732
- }, Ft = {
1733
- class: "left"
1734
- }, Dt = {
1735
- class: "right"
1736
- }, jt = /* @__PURE__ */ O({
1737
- __name: "AuthkitAppSetting",
1738
- emits: ["confirm", "cancel"],
1739
- setup(f, {
1740
- expose: l,
1741
- emit: g
1742
- }) {
1743
- const m = g;
1744
- function r() {
1745
- m("cancel");
1746
- }
1747
- function v() {
1748
- L.value = !1, m("cancel");
1749
- }
1750
- const o = y("large"), t = y(["PersonalInformation"]), V = [{
1751
- provider: "github",
1752
- name: "GitHub",
1753
- meta: {
1754
- icon: "bi:github"
1755
- }
1756
- }, {
1757
- provider: "google",
1758
- name: "Google",
1759
- meta: {
1760
- icon: "flat-color-icons:google"
1761
- }
1762
- }, {
1763
- provider: "microsoft",
1764
- name: "Microsoft",
1765
- meta: {
1766
- icon: "logos:microsoft-icon"
1767
- }
1768
- }, {
1769
- provider: "wechat",
1770
- name: "微信",
1771
- meta: {
1772
- icon: "ri:wechat-fill"
1773
- }
1774
- }], {
1775
- appsData: u
1776
- } = pe(), n = $(() => {
1777
- const _ = u.value.authMethods;
1778
- return _.signUp.email || _.login.emailPassword || _.login.emailCode;
1779
- }), p = $(() => {
1780
- const _ = u.value.authMethods;
1781
- return _.signUp.phone || _.login.phonePassword || _.login.phoneCode;
1782
- }), s = $(() => {
1783
- const _ = u.value.authMethods;
1784
- return _.login.emailPassword || _.login.phonePassword;
1785
- }), d = $(() => V.filter((_) => {
1786
- var I, F;
1787
- return (F = (I = u.value.oauth) == null ? void 0 : I[_.provider]) == null ? void 0 : F.enabled;
1788
- }).map((_) => ({
1789
- ..._,
1790
- path: `OAuthBinding:${_.provider}`
1791
- }))), z = $(() => {
1792
- const _ = [];
1793
- n.value && _.push({
1794
- name: "邮箱",
1795
- path: "EmailBinding",
1796
- meta: {
1797
- icon: "ic:baseline-email"
1798
- }
1799
- }), p.value && _.push({
1800
- name: "手机号",
1801
- path: "PhoneBinding",
1802
- meta: {
1803
- icon: "mingcute:phone-fill"
1804
- }
1805
- }), s.value && _.push({
1806
- name: "登录密码",
1807
- path: "SetPassword",
1808
- meta: {
1809
- icon: "mdi:password"
1810
- }
1811
- }), _.push({
1812
- name: "注销账号",
1813
- path: "AccountDelete",
1814
- meta: {
1815
- icon: "mdi:account-remove"
1816
- }
1817
- });
1818
- const I = [{
1819
- name: "个人信息",
1820
- path: "PersonalInformation",
1821
- meta: {
1822
- icon: "mingcute:user-edit-fill"
1823
- },
1824
- children: []
1825
- }, {
1826
- name: "账户管理",
1827
- path: "AccountManage",
1828
- meta: {
1829
- icon: "mingcute:badge-fill"
1830
- },
1831
- children: _
1832
- }];
1833
- return d.value.length > 0 && I.push({
1834
- name: "第三方账户",
1835
- path: "AccountBinding",
1836
- meta: {
1837
- icon: "mingcute:link-fill"
1838
- },
1839
- children: d.value
1840
- }), I;
1841
- }), E = $(() => d.value.find((_) => _.path === t.value[0]));
1842
- function x(_) {
1843
- const I = _.path;
1844
- t.value = [I];
1845
- }
1846
- const {
1847
- changeType: N,
1848
- show: L
1849
- } = Le(m);
1850
- de(d, (_) => {
1851
- t.value[0].startsWith("OAuthBinding:") && !_.some((I) => I.path === t.value[0]) && (t.value = ["PersonalInformation"]);
1852
- }), de(z, (_) => {
1853
- const I = t.value[0];
1854
- _.some((Q) => {
1855
- var R;
1856
- return Q.path === I || ((R = Q.children) == null ? void 0 : R.some((b) => b.path === I));
1857
- }) || (t.value = ["PersonalInformation"]);
1858
- });
1859
- function K(_, I) {
1860
- L.value = I, N.value = "编辑";
1861
- }
1862
- return l({
1863
- setData: K
1864
- }), (_, I) => (h(), w(e(Ae), {
1865
- visible: e(L),
1866
- "onUpdate:visible": I[1] || (I[1] = (F) => Ce(L) ? L.value = F : null),
1867
- "unmount-on-close": "",
1868
- "body-class": "AppSettingbodyClass",
1869
- "mask-closable": !1,
1870
- footer: !1,
1871
- width: e(be),
1872
- onCancel: r
1873
- }, {
1874
- title: a(() => [...I[2] || (I[2] = [k(" 用户信息 ", -1)])]),
1875
- default: a(() => [C("div", Ot, [C("div", Ft, [i(Ee, {
1876
- "selected-keys": t.value,
1877
- "onUpdate:selectedKeys": I[0] || (I[0] = (F) => t.value = F),
1878
- menus: z.value,
1879
- onChange: x
1880
- }, null, 8, ["selected-keys", "menus"])]), C("div", Dt, [t.value[0] === "PersonalInformation" ? (h(), w(He, {
1881
- key: 0,
1882
- size: o.value
1883
- }, null, 8, ["size"])) : P("", !0), t.value[0] === "EmailBinding" ? (h(), w(ut, {
1884
- key: 1,
1885
- size: o.value
1886
- }, null, 8, ["size"])) : P("", !0), t.value[0] === "PhoneBinding" ? (h(), w(kt, {
1887
- key: 2,
1888
- size: o.value
1889
- }, null, 8, ["size"])) : P("", !0), t.value[0] === "SetPassword" ? (h(), w(at, {
1890
- key: 3,
1891
- size: o.value
1892
- }, null, 8, ["size"])) : P("", !0), E.value ? (h(), w(qt, {
1893
- key: 4,
1894
- provider: E.value.provider,
1895
- label: E.value.name,
1896
- size: o.value
1897
- }, null, 8, ["provider", "label", "size"])) : P("", !0), t.value[0] === "AccountDelete" ? (h(), w(Mt, {
1898
- key: 5,
1899
- size: o.value,
1900
- onDeleted: v
1901
- }, null, 8, ["size"])) : P("", !0)])])]),
1902
- _: 1
1903
- }, 8, ["visible", "width"]));
1904
- }
1905
- }), ra = /* @__PURE__ */ H(jt, [["__scopeId", "data-v-dd773794"]]);
1906
- export {
1907
- ra as A,
1908
- bt as B,
1909
- ut as E,
1910
- qt as O,
1911
- tt as P,
1912
- ie as S,
1913
- kt as _,
1914
- st as a,
1915
- re as b,
1916
- He as c,
1917
- ve as d,
1918
- at as e,
1919
- ge as r,
1920
- $t as u
1921
- };