@huyooo/ui 0.4.34 → 0.4.35

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 (61) hide show
  1. package/dist/{AuthkitAppSetting-DqhUivnU.js → AuthkitAppSetting-D6PAh-ZI.js} +216 -215
  2. package/dist/{AuthkitAuthorize-f_yAVn7e.js → AuthkitAuthorize-DKG7JGSV.js} +4 -4
  3. package/dist/{FeedbackItem-DJiIQBMe.js → FeedbackItem-BO8dYYKo.js} +3 -7
  4. package/dist/FeedbackModal-B_W_RWec.js +1061 -0
  5. package/dist/MessageHandle-Dt6rb0rg.js +830 -0
  6. package/dist/{PaySubscriptions-foEcT6VN.js → PaySubscriptions-B42IdT-5.js} +59 -58
  7. package/dist/ReferrerReferees-CvuUodDZ.js +116 -0
  8. package/dist/{Upload.vue_vue_type_script_setup_true_lang-C2OaTrku.js → Upload.vue_vue_type_script_setup_true_lang-Bw3IlEUj.js} +4 -4
  9. package/dist/{UserPanel-CA3roDgH.js → UserPanel-BIKWssEY.js} +169 -174
  10. package/dist/api/Authkit/apps.d.ts +1 -1
  11. package/dist/api/Buckets/Files.d.ts +7 -7
  12. package/dist/api/Buckets.d.ts +2 -2
  13. package/dist/api/Message/ChangelogNotifications.d.ts +2 -2
  14. package/dist/api/Message/EventNotifications.d.ts +2 -2
  15. package/dist/api/Message/MessageNotifications.d.ts +5 -5
  16. package/dist/api/Message/NoticeNotifications.d.ts +2 -2
  17. package/dist/api/Messages.d.ts +2 -2
  18. package/dist/api/Referrer.d.ts +1 -1
  19. package/dist/api/index.d.ts +8 -8
  20. package/dist/authkit.js +4 -4
  21. package/dist/common/globalConfig.d.ts +15 -0
  22. package/dist/common.d.ts +1 -1
  23. package/dist/common.js +21 -19
  24. package/dist/components/Feedback/FeedbackContainer.vue.d.ts +0 -8
  25. package/dist/components/Feedback/FeedbackDetails.vue.d.ts +1 -1
  26. package/dist/components/Feedback/FeedbackForm.vue.d.ts +2 -20
  27. package/dist/components/Message/MessageAppMessage.vue.d.ts +1 -24
  28. package/dist/components/Message/MessageChangelogNotifications.vue.d.ts +1 -11
  29. package/dist/components/Message/MessageChangelogNotificationsDetails.vue.d.ts +0 -8
  30. package/dist/components/Message/MessageEventNotifications.vue.d.ts +1 -11
  31. package/dist/components/Message/MessageEventNotificationsDetails.vue.d.ts +0 -8
  32. package/dist/components/Message/MessageHandle.vue.d.ts +28 -88
  33. package/dist/components/Message/MessageNoticeNotifications.vue.d.ts +1 -11
  34. package/dist/components/Message/MessageNoticeNotificationsDetails.vue.d.ts +0 -8
  35. package/dist/components/Message/MessageNotifications.vue.d.ts +1 -11
  36. package/dist/components/Referrer/ReferrerReferees.vue.d.ts +2 -12
  37. package/dist/components/User/UserPanel.vue.d.ts +30 -100
  38. package/dist/composables/useMessageNotifications.d.ts +1 -1
  39. package/dist/composables.d.ts +1 -1
  40. package/dist/composables.js +16 -15
  41. package/dist/feedback.js +2 -2
  42. package/dist/globalConfig-dtNQA0ZH.js +15 -0
  43. package/dist/index.js +27 -25
  44. package/dist/message.js +2 -2
  45. package/dist/pay.js +1 -1
  46. package/dist/referrer.js +1 -1
  47. package/dist/style.css +1 -1
  48. package/dist/upload.js +2 -2
  49. package/dist/{useAuthkitAuthModal-OkUKCIWR.js → useAuthkitAuthModal-C153ZpNb.js} +14 -13
  50. package/dist/useAuthkitUsersProfile-CT2MN1S5.js +228 -0
  51. package/dist/useMessageNotifications-DkKSVkdt.js +106 -0
  52. package/dist/{useUploadCos-uerXQY3P.js → useUploadCos-C3ts0Gpa.js} +1481 -1499
  53. package/dist/user.d.ts +0 -1
  54. package/dist/user.js +4 -6
  55. package/package.json +1 -1
  56. package/dist/FeedbackModal-D7gtWqMr.js +0 -1077
  57. package/dist/MessageHandle-DN_JsQb2.js +0 -885
  58. package/dist/ReferrerReferees-DxNJ2ETq.js +0 -121
  59. package/dist/composables/useGlobalConfig.d.ts +0 -20
  60. package/dist/useAuthkitUsersProfile-Diituvy1.js +0 -227
  61. package/dist/useMessageNotifications-lmP0vJDM.js +0 -105
package/dist/upload.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as p } from "./Upload.vue_vue_type_script_setup_true_lang-C2OaTrku.js";
2
- import { a as s } from "./useUploadCos-uerXQY3P.js";
1
+ import { _ as p } from "./Upload.vue_vue_type_script_setup_true_lang-Bw3IlEUj.js";
2
+ import { u as s } from "./useUploadCos-C3ts0Gpa.js";
3
3
  export {
4
4
  p as Upload,
5
5
  s as useUploadCos
@@ -1,15 +1,16 @@
1
1
  import { ref as t } from "vue";
2
2
  import { api as i } from "@huyooo/api";
3
- function c(n, a) {
3
+ import { g as r } from "./globalConfig-dtNQA0ZH.js";
4
+ function f(a) {
4
5
  return i({
5
- url: `${n}/restfulApi/apps/findOne`,
6
+ url: `${r.authPrefixUrl}/restfulApi/apps/findOne`,
6
7
  method: "post",
7
8
  data: a
8
9
  });
9
10
  }
10
- function r() {
11
+ function l() {
11
12
  return i({
12
- url: "/restfulApi/apps/authPageInfo",
13
+ url: `${r.authPrefixUrl}/restfulApi/apps/authPageInfo`,
13
14
  method: "post"
14
15
  });
15
16
  }
@@ -85,29 +86,29 @@ const o = t({
85
86
  backgroundImage: "/66a0d5b35203890887f0e1a4/6714e2458fe86895bf3da8ae/1ef8ed72-1731-6e00-93d1-fa24165f1a3e.webp"
86
87
  }
87
88
  });
88
- function s() {
89
- function n(a) {
90
- r().then(({
89
+ function g() {
90
+ function a(n) {
91
+ l().then(({
91
92
  data: e
92
93
  }) => {
93
- o.value.id = e.id, o.value.appKey = e.appKey, o.value.name = e.name, o.value.description = e.description, o.value.homePageUrl = e.homePageUrl, o.value.applicationLogo = e.applicationLogo, o.value.applicationLogoUrl = e.applicationLogoUrl, o.value.oauth = e.oauth, o.value.authorizationCallback = e.authorizationCallback, o.value.aboutUs = e.aboutUs, o.value.brand = e.brand, a && a();
94
+ o.value.id = e.id, o.value.appKey = e.appKey, o.value.name = e.name, o.value.description = e.description, o.value.homePageUrl = e.homePageUrl, o.value.applicationLogo = e.applicationLogo, o.value.applicationLogoUrl = e.applicationLogoUrl, o.value.oauth = e.oauth, o.value.authorizationCallback = e.authorizationCallback, o.value.aboutUs = e.aboutUs, o.value.brand = e.brand, n && n();
94
95
  }).catch((e) => {
95
96
  console.error("获取应用认证页面信息失败:", e);
96
97
  });
97
98
  }
98
99
  return {
99
100
  appsData: o,
100
- appsAuthPageInfoApi: n
101
+ appsAuthPageInfoApi: a
101
102
  };
102
103
  }
103
104
  const p = t(!1);
104
- function f() {
105
+ function h() {
105
106
  return {
106
107
  show: p
107
108
  };
108
109
  }
109
110
  export {
110
- s as U,
111
- c as a,
112
- f as u
111
+ g as U,
112
+ f as a,
113
+ h as u
113
114
  };
@@ -0,0 +1,228 @@
1
+ import { ref as u, readonly as S, computed as A } from "vue";
2
+ import { api as a } from "@huyooo/api";
3
+ import { g as n } from "./globalConfig-dtNQA0ZH.js";
4
+ function b(e) {
5
+ return a({
6
+ url: `${n.authPrefixUrl}/restfulApi/auth/signIn`,
7
+ method: "post",
8
+ data: e
9
+ });
10
+ }
11
+ function T(e) {
12
+ return a({
13
+ url: `${n.authPrefixUrl}/restfulApi/auth/resetPassword`,
14
+ method: "post",
15
+ data: e
16
+ });
17
+ }
18
+ function x(e) {
19
+ return a({
20
+ url: `${n.authPrefixUrl}/restfulApi/auth/signUp`,
21
+ method: "post",
22
+ data: e
23
+ });
24
+ }
25
+ function G(e) {
26
+ return a({
27
+ url: `${n.authPrefixUrl}/restfulApi/oauth2/authorize`,
28
+ method: "post",
29
+ data: e
30
+ });
31
+ }
32
+ const c = u("signIn"), g = [], m = [], w = [], i = u(null);
33
+ function y() {
34
+ try {
35
+ const e = localStorage.getItem("jwtToken");
36
+ if (e)
37
+ return i.value = e, !0;
38
+ } catch (e) {
39
+ console.warn("Failed to access localStorage:", e);
40
+ }
41
+ return !1;
42
+ }
43
+ function $() {
44
+ if (i.value)
45
+ return i.value;
46
+ try {
47
+ const e = localStorage.getItem("jwtToken");
48
+ return e && (i.value = e), e;
49
+ } catch (e) {
50
+ return console.warn("Failed to access localStorage:", e), null;
51
+ }
52
+ }
53
+ function p(e) {
54
+ i.value = e;
55
+ try {
56
+ localStorage.setItem("jwtToken", e);
57
+ } catch (l) {
58
+ console.warn("Failed to save token to localStorage:", l);
59
+ }
60
+ }
61
+ function C() {
62
+ i.value = null;
63
+ try {
64
+ localStorage.removeItem("jwtToken");
65
+ } catch (e) {
66
+ console.warn("Failed to clear localStorage:", e);
67
+ }
68
+ }
69
+ function j(e) {
70
+ g.push(e);
71
+ }
72
+ function E(e) {
73
+ m.push(e);
74
+ }
75
+ function V(e) {
76
+ w.push(e);
77
+ }
78
+ function F() {
79
+ const e = u(!1), l = u(!1), f = u(!1);
80
+ function h(r) {
81
+ e.value = !0, b({
82
+ email: r.email,
83
+ password: r.password
84
+ }).then(({
85
+ data: t
86
+ }) => {
87
+ e.value = !1, p(t.jwtToken), g.forEach((I) => I(t));
88
+ }).catch((t) => {
89
+ e.value = !1, console.error("登录失败:", t);
90
+ });
91
+ }
92
+ function o(r) {
93
+ l.value = !0, x({
94
+ email: r.email,
95
+ userToken: r.userToken,
96
+ emailVerifyId: r.emailVerifyId,
97
+ password: r.password,
98
+ referrerId: r.referrerId
99
+ }).then(() => {
100
+ l.value = !1, c.value = "signIn", m.forEach((t) => t());
101
+ }).catch((t) => {
102
+ l.value = !1, console.error("注册失败:", t);
103
+ });
104
+ }
105
+ function v(r) {
106
+ f.value = !0, T({
107
+ email: r.email,
108
+ userToken: r.userToken,
109
+ emailVerifyId: r.emailVerifyId,
110
+ password: r.password
111
+ }).then(() => {
112
+ f.value = !1, c.value = "signIn", w.forEach((t) => t());
113
+ }).catch((t) => {
114
+ f.value = !1, console.error("重置密码失败:", t);
115
+ });
116
+ }
117
+ function k() {
118
+ c.value = "signUp";
119
+ }
120
+ function U() {
121
+ c.value = "resetPassword";
122
+ }
123
+ function P() {
124
+ c.value = "signIn";
125
+ }
126
+ return {
127
+ signInSubmit: h,
128
+ signUpSubmit: o,
129
+ resetPasswordSubmit: v,
130
+ currentView: c,
131
+ authSignInLoading: e,
132
+ authSignUpLoading: l,
133
+ resetPasswordLoading: f,
134
+ switchSignUp: k,
135
+ switchResetPassword: U,
136
+ switchSignIn: P,
137
+ addSignInCallback: j,
138
+ addSignUpCallback: E,
139
+ addResetPasswordCallback: V,
140
+ // 简化的token管理
141
+ jwtToken: S(i),
142
+ getToken: $,
143
+ setToken: p,
144
+ initializeAuth: y,
145
+ clearAuth: C
146
+ };
147
+ }
148
+ function L(e) {
149
+ return console.log(n.authPrefixUrl, "globalConfig.authPrefixUrl"), a({
150
+ url: `${n.authPrefixUrl}/restfulApi/users/profile`,
151
+ method: "post",
152
+ data: e
153
+ });
154
+ }
155
+ function H(e) {
156
+ return a({
157
+ url: `${n.authPrefixUrl}/restfulApi/users/update/baseInfo`,
158
+ method: "post",
159
+ data: e
160
+ });
161
+ }
162
+ function J(e) {
163
+ return a({
164
+ url: `${n.authPrefixUrl}/restfulApi/users/update/email`,
165
+ method: "post",
166
+ data: e
167
+ });
168
+ }
169
+ function K(e) {
170
+ return a({
171
+ url: `${n.authPrefixUrl}/restfulApi/users/update/password`,
172
+ method: "post",
173
+ data: e
174
+ });
175
+ }
176
+ function M() {
177
+ return a({
178
+ url: `${n.authPrefixUrl}/restfulApi/users//unbind/email`,
179
+ method: "post"
180
+ });
181
+ }
182
+ const s = u(null), d = u(!1), z = A(() => !!s.value);
183
+ async function R() {
184
+ var h;
185
+ const {
186
+ getToken: e,
187
+ clearAuth: l
188
+ } = F();
189
+ if (!e()) {
190
+ console.warn("No authentication token found"), s.value = null;
191
+ return;
192
+ }
193
+ d.value = !0;
194
+ try {
195
+ const {
196
+ data: o
197
+ } = await L();
198
+ o ? s.value = o : (console.warn("获取用户资料返回空数据"), s.value = null);
199
+ } catch (o) {
200
+ console.error("获取用户资料失败:", o), ((h = o == null ? void 0 : o.response) == null ? void 0 : h.status) === 401 && (console.warn("认证已过期,清除认证状态"), l()), s.value = null;
201
+ } finally {
202
+ d.value = !1;
203
+ }
204
+ }
205
+ function B() {
206
+ s.value = null;
207
+ }
208
+ function O() {
209
+ return {
210
+ userProfile: s,
211
+ loading: d,
212
+ isLoggedIn: z,
213
+ // 新增:基于userProfile的登录状态
214
+ fetchUserProfile: R,
215
+ clearUserProfile: B
216
+ // 新增:清除用户信息的方法
217
+ };
218
+ }
219
+ export {
220
+ O as a,
221
+ L as b,
222
+ H as c,
223
+ K as d,
224
+ J as e,
225
+ M as f,
226
+ G as o,
227
+ F as u
228
+ };
@@ -0,0 +1,106 @@
1
+ import { ref as a, computed as x } from "vue";
2
+ import { api as c } from "@huyooo/api";
3
+ import { g } from "./globalConfig-dtNQA0ZH.js";
4
+ function z(t) {
5
+ return c({
6
+ url: `${g.prefixUrl}/restfulApi/messageCenter/messageNotifications/find`,
7
+ method: "post",
8
+ data: t
9
+ });
10
+ }
11
+ function R(t) {
12
+ return c({
13
+ url: `${g.prefixUrl}/restfulApi/messageCenter/messageNotifications/read`,
14
+ method: "post",
15
+ data: t
16
+ });
17
+ }
18
+ function S(t) {
19
+ return c({
20
+ url: `${g.prefixUrl}/restfulApi/messageCenter/messageNotifications/readAll`,
21
+ method: "post",
22
+ data: t
23
+ });
24
+ }
25
+ function k(t = "system") {
26
+ const u = a(!0), d = a(""), i = a(!1), m = a(!1), r = a([]), s = a({
27
+ total: 0,
28
+ current: 1,
29
+ pageSize: 10
30
+ }), n = a(!1), o = a(!1), f = a("unread"), A = [{
31
+ label: "未读消息",
32
+ key: "unread"
33
+ }, {
34
+ label: "已读消息",
35
+ key: "read"
36
+ }], v = x(() => f.value === "read");
37
+ function N() {
38
+ u.value = !0;
39
+ }
40
+ function b(e) {
41
+ f.value = e, s.value.current = 1, l();
42
+ }
43
+ function p(e) {
44
+ n.value = !0, R({
45
+ messageId: e
46
+ }).then(() => {
47
+ n.value = !1;
48
+ }).catch(() => {
49
+ n.value = !1;
50
+ });
51
+ }
52
+ function h(e) {
53
+ o.value = !0, S({
54
+ type: e
55
+ }).then(() => {
56
+ o.value = !1, l();
57
+ }).catch(() => {
58
+ o.value = !1;
59
+ });
60
+ }
61
+ function C() {
62
+ r.value.length !== 0 && h(t);
63
+ }
64
+ function l() {
65
+ i.value = !0, z({
66
+ current: s.value.current,
67
+ pageSize: s.value.pageSize,
68
+ where: {
69
+ read: v.value,
70
+ type: t
71
+ }
72
+ }).then(({
73
+ data: e
74
+ }) => {
75
+ i.value = !1, r.value = e.items, s.value.total = e.count, m.value = e.items.length < s.value.pageSize;
76
+ }).catch(() => {
77
+ i.value = !1;
78
+ });
79
+ }
80
+ function L(e) {
81
+ d.value = e.id, u.value = !1, p(e.id);
82
+ }
83
+ return l(), {
84
+ isList: u,
85
+ id: d,
86
+ loading: i,
87
+ finished: m,
88
+ messageList: r,
89
+ pagination: s,
90
+ readLoading: n,
91
+ readAllLoading: o,
92
+ activeTab: f,
93
+ tabs: A,
94
+ read: v,
95
+ toList: N,
96
+ onTabChange: b,
97
+ messageNotificationsReadApi: p,
98
+ messageNotificationsReadAllApi: h,
99
+ readAll: C,
100
+ getData: l,
101
+ openDetails: L
102
+ };
103
+ }
104
+ export {
105
+ k as u
106
+ };