@huyooo/ui 0.5.23 → 0.5.24

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 (41) hide show
  1. package/dist/{AuthkitAuthModal-EtAHk3jC.js → AuthkitAuthModal-BdVB7Kz7.js} +517 -482
  2. package/dist/{AuthkitAuthorize-iudRkudt.js → AuthkitAuthorize-bzCh_YJp.js} +2 -2
  3. package/dist/{Clipboard-CIWjWQOZ.js → Clipboard-Bful1lNJ.js} +3 -2
  4. package/dist/{Contact-Dy9U5zuU.js → Contact-DNiynQXl.js} +2 -2
  5. package/dist/{FeedbackItem-4WHDAqT0.js → FeedbackItem-DFCuTCaI.js} +3 -3
  6. package/dist/{FeedbackModal-Cf9lDRpp.js → FeedbackModal-BGXr3jPm.js} +6 -5
  7. package/dist/LandingPageSectionTabs-BrAxO3Ad.js +29013 -0
  8. package/dist/{MessageHandle-CVsfCWky.js → MessageHandle-De7eLBi_.js} +16 -16
  9. package/dist/{PaySubscriptions-CMSBkkoi.js → PaySubscriptions-77rXNTOt.js} +8 -8
  10. package/dist/{ReferrerReferees-BFF_mWBd.js → ReferrerReferees-DCALYxND.js} +7 -7
  11. package/dist/{Upload.vue_vue_type_script_setup_true_lang-DA9w3O2R.js → Upload.vue_vue_type_script_setup_true_lang-9HB-tLZd.js} +2 -2
  12. package/dist/{UserAccountMenu-8Vqgdtq1.js → UserAccountMenu-ul2FbWYe.js} +12 -11
  13. package/dist/{WidthContainer-CeJ1eykf.js → WidthContainer-DmwEcM3F.js} +27 -24
  14. package/dist/authkit.js +6 -6
  15. package/dist/common.js +1 -1
  16. package/dist/composables.js +31 -30
  17. package/dist/feedback.js +3 -3
  18. package/dist/globalConfig-C1YOJcxa.js +22 -0
  19. package/dist/index.js +699 -615
  20. package/dist/landingPage.js +1 -1
  21. package/dist/message.js +2 -2
  22. package/dist/pay.js +1 -1
  23. package/dist/privateCom.js +1 -1
  24. package/dist/referrer.js +1 -1
  25. package/dist/style.css +1 -1
  26. package/dist/upload.js +2 -2
  27. package/dist/{useAuthkitAppsAuthPageInfo-C7KEv8pi.js → useAuthkitAppsAuthPageInfo-Dyjhw7qb.js} +1 -1
  28. package/dist/useAuthkitAuthModal-BpOmabWi.js +10 -0
  29. package/dist/useAuthkitCreateAndUpdate-BpPW409v.js +25 -0
  30. package/dist/useAuthkitUsersProfile-zbKT0W_h.js +237 -0
  31. package/dist/{useDownloads-BpQUd6AV.js → useDownloads-DnMYa52H.js} +5 -4
  32. package/dist/{useMessageNotifications-DZBBxw31.js → useMessageNotifications-DSRanuRe.js} +8 -8
  33. package/dist/{useSEO-sQmoCl0K.js → useSEO-BKJkX1nG.js} +2 -2
  34. package/dist/{useTableHandle-DujKY4Bl.js → useTableHandle-DKUIdSSh.js} +15 -14
  35. package/dist/{useUploadCos-CNKDNSrg.js → useUploadCos-D5k1YLb7.js} +1 -1
  36. package/dist/user.js +1 -1
  37. package/package.json +1 -1
  38. package/dist/LandingPageSectionTabs-BL4lLDsT.js +0 -19776
  39. package/dist/auth-DafjnKRu.js +0 -180
  40. package/dist/useAuthkitCreateAndUpdate-BpTxxKc0.js +0 -24
  41. package/dist/useAuthkitUsersProfile-eWz3ShS9.js +0 -198
@@ -1,180 +0,0 @@
1
- /* empty css */
2
- import { Message as u } from "@arco-design/web-vue";
3
- import { api as n } from "@huyooo/api";
4
- import { ref as p } from "vue";
5
- function y(e, r = 3) {
6
- const t = e.indexOf("@");
7
- if (t > 1) {
8
- const o = e.slice(0, r), c = e.slice(t);
9
- return o + "***" + c;
10
- }
11
- return e;
12
- }
13
- function h() {
14
- try {
15
- localStorage.removeItem("jwtToken"), localStorage.removeItem("refreshToken");
16
- } catch (e) {
17
- console.warn("Failed to clear localStorage:", e);
18
- }
19
- }
20
- function k() {
21
- try {
22
- return localStorage.getItem("refreshToken");
23
- } catch (e) {
24
- return console.warn("Failed to get refreshToken from localStorage:", e), null;
25
- }
26
- }
27
- function m(e) {
28
- try {
29
- localStorage.setItem("jwtToken", e);
30
- } catch (r) {
31
- console.warn("Failed to update jwtToken in localStorage:", r);
32
- }
33
- }
34
- let a = {
35
- appId: "",
36
- prefixUrl: "",
37
- authPrefixUrl: "",
38
- avatarBucketId: "68350c206888f565dc7d09e9",
39
- feedbackBucketId: "6826e4db6888f565dc775dce",
40
- bucket: "ones-1358549778",
41
- region: "ap-beijing",
42
- web3formsAccessKey: "72604aac-d55e-4df0-9bcf-31b2206b3753"
43
- }, g = {};
44
- function A(e) {
45
- Object.assign(g, e);
46
- }
47
- function S(e) {
48
- a.appId = e.appId, a.prefixUrl = e.prefixUrl, a.authPrefixUrl = e.authPrefixUrl, e.avatarBucketId !== void 0 && (a.avatarBucketId = e.avatarBucketId), e.feedbackBucketId !== void 0 && (a.feedbackBucketId = e.feedbackBucketId), e.bucket !== void 0 && (a.bucket = e.bucket), e.region !== void 0 && (a.region = e.region), e.web3formsAccessKey !== void 0 && (a.web3formsAccessKey = e.web3formsAccessKey);
49
- }
50
- const b = p(!1);
51
- function T() {
52
- return {
53
- show: b
54
- };
55
- }
56
- let i = !1, f = [];
57
- function d(e, r = null) {
58
- f.forEach(({
59
- resolve: t,
60
- reject: o
61
- }) => {
62
- e ? o(e) : t(r);
63
- }), f = [];
64
- }
65
- async function I() {
66
- var r;
67
- const e = k();
68
- if (!e)
69
- throw new Error("No refresh token available");
70
- try {
71
- const t = await P(e), {
72
- data: o
73
- } = t;
74
- if (o.success && ((r = o.data) != null && r.jwtToken))
75
- return m(o.data.jwtToken), o.data.refreshToken && localStorage.setItem("refreshToken", o.data.refreshToken), o.data.jwtToken;
76
- throw new Error(o.message || "Token refresh failed");
77
- } catch (t) {
78
- throw console.error("Token refresh failed:", t), h(), t;
79
- }
80
- }
81
- n.interceptors.request.use((e) => {
82
- console.log(e, "configconfig");
83
- const r = localStorage.getItem("jwtToken");
84
- return r && (e.headers.authorization = `Bearer ${r}`), e.headers["app-id"] = a.appId, e;
85
- }, (e) => Promise.reject(e));
86
- n.interceptors.response.use(async (e) => {
87
- const {
88
- data: {
89
- message: r,
90
- success: t,
91
- code: o
92
- }
93
- } = e;
94
- if (console.log(e.data, "dsdsds"), t)
95
- return e.data;
96
- if (o === 40101) {
97
- console.log(e, "response");
98
- const c = e.config;
99
- if (i)
100
- return new Promise((s, l) => {
101
- f.push({
102
- resolve: s,
103
- reject: l
104
- });
105
- }).then((s) => (c.headers.authorization = `Bearer ${s}`, n(c))).catch((s) => Promise.reject(s));
106
- c._retry = !0, i = !0;
107
- try {
108
- const s = await I();
109
- return d(null, s), c.headers.authorization = `Bearer ${s}`, n(c);
110
- } catch (s) {
111
- d(s, null), h();
112
- const {
113
- show: l
114
- } = T();
115
- return l.value = !0, Promise.reject(s);
116
- } finally {
117
- i = !1;
118
- }
119
- } else
120
- return u.error(r), Promise.reject(e.data);
121
- }, (e) => {
122
- if (e.response) {
123
- const {
124
- data: r
125
- } = e.response, {
126
- message: t
127
- } = r || {};
128
- console.log(e.response, "error.response"), console.error("Error Response:", e.response), u.error(t || "服务错误");
129
- } else e.request ? (console.error("Error Request:", e.request), u.error("网络错误,请检查网络连接")) : (console.error("Error Message:", e.message), u.error(e.message || "服务错误"));
130
- return Promise.reject(e);
131
- });
132
- function U(e) {
133
- return n({
134
- url: `${a.authPrefixUrl}/restfulApi/auth/signIn`,
135
- method: "post",
136
- data: e
137
- });
138
- }
139
- function B(e) {
140
- return n({
141
- url: `${a.authPrefixUrl}/restfulApi/auth/resetPassword`,
142
- method: "post",
143
- data: e
144
- });
145
- }
146
- function E(e) {
147
- return n({
148
- url: `${a.authPrefixUrl}/restfulApi/auth/signUp`,
149
- method: "post",
150
- data: e
151
- });
152
- }
153
- function R(e) {
154
- return n({
155
- url: `${a.authPrefixUrl}/restfulApi/oauth2/authorize`,
156
- method: "post",
157
- data: e
158
- });
159
- }
160
- function P(e) {
161
- return n({
162
- url: "/restfulApi/auth/refresh",
163
- method: "post",
164
- data: {
165
- refreshToken: e
166
- }
167
- });
168
- }
169
- export {
170
- g as a,
171
- A as b,
172
- B as c,
173
- E as d,
174
- U as e,
175
- a as g,
176
- y as h,
177
- R as o,
178
- S as s,
179
- T as u
180
- };
@@ -1,24 +0,0 @@
1
- /* empty css */
2
- import { Message as r } from "@arco-design/web-vue";
3
- import { ref as e } from "vue";
4
- function d(s) {
5
- const n = e(!1), a = e(), o = e(!1), c = e(""), l = e("");
6
- function t(u) {
7
- r.success(u), o.value = !1, n.value = !1, s("confirm");
8
- }
9
- function f() {
10
- o.value = !1, console.log("handleClose"), s("cancel");
11
- }
12
- return {
13
- loading: n,
14
- formRef: a,
15
- submitSuccess: t,
16
- modelType: c,
17
- changeType: l,
18
- show: o,
19
- handleCancel: f
20
- };
21
- }
22
- export {
23
- d as u
24
- };
@@ -1,198 +0,0 @@
1
- import { ref as l, readonly as b, computed as T } from "vue";
2
- import { c as y, d as A, e as x, g as i } from "./auth-DafjnKRu.js";
3
- import { api as d } from "@huyooo/api";
4
- const u = l("signIn"), v = [], m = [], w = [], t = l(null);
5
- function C() {
6
- try {
7
- const e = localStorage.getItem("jwtToken");
8
- if (e)
9
- return t.value = e, !0;
10
- } catch (e) {
11
- console.warn("Failed to access localStorage:", e);
12
- }
13
- return !1;
14
- }
15
- function j() {
16
- if (t.value)
17
- return t.value;
18
- try {
19
- const e = localStorage.getItem("jwtToken");
20
- return e && (t.value = e), e;
21
- } catch (e) {
22
- return console.warn("Failed to access localStorage:", e), null;
23
- }
24
- }
25
- function p(e) {
26
- t.value = e;
27
- try {
28
- localStorage.setItem("jwtToken", e);
29
- } catch (o) {
30
- console.warn("Failed to save token to localStorage:", o);
31
- }
32
- }
33
- function E() {
34
- t.value = null;
35
- try {
36
- localStorage.removeItem("jwtToken");
37
- } catch (e) {
38
- console.warn("Failed to clear localStorage:", e);
39
- }
40
- }
41
- function V(e) {
42
- v.push(e);
43
- }
44
- function $(e) {
45
- m.push(e);
46
- }
47
- function F(e) {
48
- w.push(e);
49
- }
50
- function L() {
51
- const e = l(!1), o = l(!1), c = l(!1);
52
- function h(a) {
53
- e.value = !0, x({
54
- email: a.email,
55
- password: a.password
56
- }).then(({
57
- data: r
58
- }) => {
59
- e.value = !1, p(r.jwtToken), v.forEach((S) => S(r));
60
- }).catch((r) => {
61
- e.value = !1, console.error("登录失败:", r);
62
- });
63
- }
64
- function n(a) {
65
- o.value = !0, A({
66
- email: a.email,
67
- userToken: a.userToken,
68
- emailVerifyId: a.emailVerifyId,
69
- password: a.password,
70
- referrerId: a.referrerId
71
- }).then(() => {
72
- o.value = !1, u.value = "signIn", m.forEach((r) => r());
73
- }).catch((r) => {
74
- o.value = !1, console.error("注册失败:", r);
75
- });
76
- }
77
- function k(a) {
78
- c.value = !0, y({
79
- email: a.email,
80
- userToken: a.userToken,
81
- emailVerifyId: a.emailVerifyId,
82
- password: a.password
83
- }).then(() => {
84
- c.value = !1, u.value = "signIn", w.forEach((r) => r());
85
- }).catch((r) => {
86
- c.value = !1, console.error("重置密码失败:", r);
87
- });
88
- }
89
- function I() {
90
- u.value = "signUp";
91
- }
92
- function P() {
93
- u.value = "resetPassword";
94
- }
95
- function U() {
96
- u.value = "signIn";
97
- }
98
- return {
99
- signInSubmit: h,
100
- signUpSubmit: n,
101
- resetPasswordSubmit: k,
102
- currentView: u,
103
- authSignInLoading: e,
104
- authSignUpLoading: o,
105
- resetPasswordLoading: c,
106
- switchSignUp: I,
107
- switchResetPassword: P,
108
- switchSignIn: U,
109
- addSignInCallback: V,
110
- addSignUpCallback: $,
111
- addResetPasswordCallback: F,
112
- // 简化的token管理
113
- jwtToken: b(t),
114
- getToken: j,
115
- setToken: p,
116
- initializeAuth: C,
117
- clearAuth: E
118
- };
119
- }
120
- function R(e) {
121
- return console.log(i.authPrefixUrl, "globalConfig.authPrefixUrl"), d({
122
- url: `${i.authPrefixUrl}/restfulApi/users/profile`,
123
- method: "post",
124
- data: e
125
- });
126
- }
127
- function H(e) {
128
- return d({
129
- url: `${i.authPrefixUrl}/restfulApi/users/update/baseInfo`,
130
- method: "post",
131
- data: e
132
- });
133
- }
134
- function J(e) {
135
- return d({
136
- url: `${i.authPrefixUrl}/restfulApi/users/update/email`,
137
- method: "post",
138
- data: e
139
- });
140
- }
141
- function K(e) {
142
- return d({
143
- url: `${i.authPrefixUrl}/restfulApi/users/update/password`,
144
- method: "post",
145
- data: e
146
- });
147
- }
148
- function M() {
149
- return d({
150
- url: `${i.authPrefixUrl}/restfulApi/users//unbind/email`,
151
- method: "post"
152
- });
153
- }
154
- const s = l(null), g = l(!1), f = l(!1), z = T(() => !!s.value);
155
- async function B() {
156
- var h;
157
- const {
158
- getToken: e,
159
- clearAuth: o
160
- } = L();
161
- if (!e()) {
162
- console.warn("No authentication token found"), s.value = null;
163
- return;
164
- }
165
- g.value = !0, f.value = !1;
166
- try {
167
- const {
168
- data: n
169
- } = await R();
170
- g.value = !1, n ? (s.value = n, f.value = !0) : (console.warn("获取用户资料返回空数据"), s.value = null, f.value = !1);
171
- } catch (n) {
172
- g.value = !1, f.value = !1, console.error("获取用户资料失败:", n), ((h = n == null ? void 0 : n.response) == null ? void 0 : h.status) === 401 && (console.warn("认证已过期,清除认证状态"), o()), s.value = null;
173
- }
174
- }
175
- function N() {
176
- s.value = null;
177
- }
178
- function O() {
179
- return {
180
- userProfile: s,
181
- loading: g,
182
- usersProfileSuccess: f,
183
- isLoggedIn: z,
184
- // 新增:基于userProfile的登录状态
185
- fetchUserProfile: B,
186
- clearUserProfile: N
187
- // 新增:清除用户信息的方法
188
- };
189
- }
190
- export {
191
- O as a,
192
- R as b,
193
- H as c,
194
- K as d,
195
- J as e,
196
- M as f,
197
- L as u
198
- };