@huyooo/ui 0.4.8 → 0.4.11

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 (47) hide show
  1. package/dist/{AuthkitAppSetting-BTQp9Blh.js → AuthkitAppSetting-B_ddDZoJ.js} +476 -457
  2. package/dist/{AuthkitAuthorize-CP26s3ny.js → AuthkitAuthorize-DEGTLm9-.js} +33 -33
  3. package/dist/{CustomTable-Cd6RiAPX.js → CustomTable-DbiCOvmO.js} +209 -205
  4. package/dist/{FeedbackFeedBackItem-DYUIzqYg.js → FeedbackFeedBackItem-D1JwJFBF.js} +2 -2
  5. package/dist/{FeedbackFeedBackModal-DKgZZ8OR.js → FeedbackFeedBackModal-DOocV38w.js} +597 -596
  6. package/dist/InfiniteLoading-BOurBPUR.js +66 -0
  7. package/dist/{Menu-2SePYCYT.js → Menu-MZJINp6f.js} +32 -32
  8. package/dist/{MessageHandle-C9nSNw5A.js → MessageHandle-cZ2FXsJ5.js} +220 -260
  9. package/dist/{PaySubscriptions-CFKM4gyf.js → PaySubscriptions-MYoi8Ob_.js} +1 -1
  10. package/dist/{ReferrerReferees-q8H-v-Hq.js → ReferrerReferees-CFwb0s28.js} +49 -49
  11. package/dist/{Upload.vue_vue_type_script_setup_true_lang-DqfW_OJJ.js → Upload.vue_vue_type_script_setup_true_lang-uy8hhi_o.js} +1 -1
  12. package/dist/{UserPanel-BoDqMItR.js → UserPanel-BhAJ5Dya.js} +167 -168
  13. package/dist/api/Authkit/Users.d.ts +5 -4
  14. package/dist/api/Authkit/auth.d.ts +5 -4
  15. package/dist/authkit.js +3 -3
  16. package/dist/common.js +9 -9
  17. package/dist/components/InfiniteLoading.vue.d.ts +40 -4
  18. package/dist/components/Upload/Upload.vue.d.ts +2 -2
  19. package/dist/components/User/UserAvatar.vue.d.ts +1 -1
  20. package/dist/components/User/UserBasicInformation.vue.d.ts +1 -1
  21. package/dist/composables/Authkit/useAuthkitAuth.d.ts +1 -1
  22. package/dist/composables/Authkit/useAuthkitProps.d.ts +5 -0
  23. package/dist/composables/Authkit/useAuthkitUsersProfile.d.ts +143 -1
  24. package/dist/composables/usePolling.d.ts +27 -0
  25. package/dist/composables/useUserPanelProps.d.ts +27 -5
  26. package/dist/composables.js +3 -3
  27. package/dist/feedback.js +2 -2
  28. package/dist/index.js +47 -47
  29. package/dist/message.d.ts +1 -1
  30. package/dist/message.js +9 -8
  31. package/dist/pay.js +1 -1
  32. package/dist/referrer.js +1 -1
  33. package/dist/style.css +1 -1
  34. package/dist/types/api.d.ts +133 -0
  35. package/dist/upload.js +2 -2
  36. package/dist/useAuthkitProps-DXXCuvZp.js +325 -0
  37. package/dist/{useUploadCos-DpOqkozy.js → useUploadCos-B8D9lYIk.js} +1486 -1489
  38. package/dist/useUserPanelProps-C5W72fZJ.js +54 -0
  39. package/dist/user.js +2 -2
  40. package/dist/utils/authkit.d.ts +7 -1
  41. package/dist/utils/configHelper.d.ts +17 -0
  42. package/dist/utils/errorHandler.d.ts +32 -0
  43. package/dist/utils/index.d.ts +11 -1
  44. package/package.json +1 -1
  45. package/dist/components/Message/MessageInfiniteLoading.vue.d.ts +0 -29
  46. package/dist/useAuthkitProps-BnIq3hzQ.js +0 -283
  47. package/dist/useUserPanelProps-Dt9zkMJw.js +0 -14
@@ -0,0 +1,133 @@
1
+ export interface ApiResponse<T = any> {
2
+ data: T;
3
+ code?: number;
4
+ message?: string;
5
+ success?: boolean;
6
+ }
7
+ export interface PaginationParams {
8
+ current: number;
9
+ pageSize: number;
10
+ where?: Record<string, any>;
11
+ }
12
+ export interface PaginatedResponse<T> {
13
+ items: T[];
14
+ count: number;
15
+ current: number;
16
+ pageSize: number;
17
+ }
18
+ export interface IdParams {
19
+ id: string;
20
+ }
21
+ export interface FeedbackCreateParams {
22
+ title: string;
23
+ type: string;
24
+ description: string;
25
+ screenshots?: string[];
26
+ }
27
+ export interface FeedbackUpdateParams {
28
+ id: string;
29
+ title?: string;
30
+ type?: string;
31
+ description?: string;
32
+ status?: string;
33
+ }
34
+ export interface FeedbackItem {
35
+ id: string;
36
+ title: string;
37
+ type: string;
38
+ description: string;
39
+ status: string;
40
+ createAt: string;
41
+ updateAt: string;
42
+ }
43
+ export interface SignInParams {
44
+ email: string;
45
+ password: string;
46
+ }
47
+ export interface SignUpParams {
48
+ email: string;
49
+ password: string;
50
+ userToken: string;
51
+ emailVerifyId: string;
52
+ source?: string;
53
+ isRecommend?: boolean;
54
+ }
55
+ export interface ResetPasswordParams {
56
+ email: string;
57
+ password: string;
58
+ userToken: string;
59
+ emailVerifyId: string;
60
+ }
61
+ export interface OAuth2AuthorizeParams {
62
+ client_id: string;
63
+ response_type: string;
64
+ scope: string;
65
+ state: string;
66
+ redirect_uri: string;
67
+ }
68
+ export interface UserUpdateBaseInfoParams {
69
+ nickname?: string;
70
+ description?: string;
71
+ avatar?: string;
72
+ }
73
+ export interface UserUpdateEmailParams {
74
+ email: string;
75
+ userToken: string;
76
+ emailVerifyId: string;
77
+ }
78
+ export interface UserUpdatePasswordParams {
79
+ password: string;
80
+ }
81
+ export interface FileCreateParams {
82
+ bucketId: string;
83
+ filename: string;
84
+ name: string;
85
+ size: number;
86
+ type: string;
87
+ webkitRelativePath?: string;
88
+ }
89
+ export interface FileUpdateParams {
90
+ id: string | null;
91
+ status: 'success' | 'fail';
92
+ }
93
+ export interface FileCredentialsParams {
94
+ filename: string;
95
+ bucketId: string;
96
+ size: number;
97
+ type: string;
98
+ }
99
+ export interface MessageNotificationParams {
100
+ current: number;
101
+ pageSize: number;
102
+ where: {
103
+ read?: boolean;
104
+ type?: string;
105
+ };
106
+ }
107
+ export interface MessageReadParams {
108
+ messageId: string;
109
+ }
110
+ export interface MessageReadAllParams {
111
+ type: string;
112
+ }
113
+ export interface OrderCreateParams {
114
+ productId: string;
115
+ quantity: number;
116
+ amount: number;
117
+ }
118
+ export interface OrderItem {
119
+ id: string;
120
+ productId: string;
121
+ quantity: number;
122
+ amount: number;
123
+ status: string;
124
+ createAt: string;
125
+ }
126
+ export interface EmailVerifyParams {
127
+ email: string;
128
+ purpose: 'signUp' | 'resetPassword' | 'updateEmail';
129
+ }
130
+ export interface PasswordVerifyParams {
131
+ email: string;
132
+ password: string;
133
+ }
package/dist/upload.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as p } from "./Upload.vue_vue_type_script_setup_true_lang-DqfW_OJJ.js";
2
- import { u as s } from "./useUploadCos-DpOqkozy.js";
1
+ import { _ as p } from "./Upload.vue_vue_type_script_setup_true_lang-uy8hhi_o.js";
2
+ import { u as s } from "./useUploadCos-B8D9lYIk.js";
3
3
  export {
4
4
  p as Upload,
5
5
  s as useUploadCos
@@ -0,0 +1,325 @@
1
+ import { ref as u, computed as b } from "vue";
2
+ import { api as s } from "@huyooo/api";
3
+ function O(e, t) {
4
+ return s({
5
+ url: `${e}/restfulApi/apps/findOne`,
6
+ method: "post",
7
+ data: t
8
+ });
9
+ }
10
+ function V() {
11
+ return s({
12
+ url: "/restfulApi/apps/authPageInfo",
13
+ method: "post"
14
+ });
15
+ }
16
+ const i = u({
17
+ id: "",
18
+ appKey: "",
19
+ name: "",
20
+ description: "",
21
+ homePageUrl: "",
22
+ applicationLogo: "",
23
+ applicationLogoUrl: "",
24
+ oauth: {
25
+ google: {
26
+ // redirectURI: '',
27
+ // clientID: '',
28
+ // clientSecret: '',
29
+ enabled: !1
30
+ },
31
+ microsoft: {
32
+ // redirectURI: '',
33
+ // clientID: '',
34
+ // clientSecret: '',
35
+ enabled: !1
36
+ },
37
+ github: {
38
+ // redirectURI: '',
39
+ // clientID: '',
40
+ // clientSecret: '',
41
+ enabled: !1
42
+ },
43
+ wechat: {
44
+ // redirectURI: '',
45
+ // clientID: '',
46
+ // clientSecret: '',
47
+ enabled: !1
48
+ }
49
+ },
50
+ authorizationCallback: "",
51
+ aboutUs: {
52
+ // 个人信息收集清单
53
+ personalInformationCollectionList: {
54
+ type: "doc",
55
+ content: []
56
+ },
57
+ // 第三方信息共享清单
58
+ thirdPartyInformationSharingList: {
59
+ type: "doc",
60
+ content: []
61
+ },
62
+ // 用户服务协议
63
+ userServiceAgreement: {
64
+ type: "doc",
65
+ content: []
66
+ },
67
+ // 隐私协议
68
+ privacyPolicy: {
69
+ type: "doc",
70
+ content: []
71
+ },
72
+ // 证照信息
73
+ licenseInformation: {
74
+ type: "doc",
75
+ content: []
76
+ }
77
+ },
78
+ brand: {
79
+ theme: "dark",
80
+ logo: "",
81
+ favicon: "",
82
+ backgroundType: "image",
83
+ backgroundColor: "",
84
+ backgroundImage: "/66a0d5b35203890887f0e1a4/6714e2458fe86895bf3da8ae/1ef8ed72-1731-6e00-93d1-fa24165f1a3e.webp"
85
+ }
86
+ });
87
+ function Z() {
88
+ function e(t) {
89
+ V().then(({
90
+ data: a
91
+ }) => {
92
+ i.value.id = a.id, i.value.appKey = a.appKey, i.value.name = a.name, i.value.description = a.description, i.value.homePageUrl = a.homePageUrl, i.value.applicationLogo = a.applicationLogo, i.value.applicationLogoUrl = a.applicationLogoUrl, i.value.oauth = a.oauth, i.value.authorizationCallback = a.authorizationCallback, i.value.aboutUs = a.aboutUs, i.value.brand = a.brand, t && t();
93
+ }).catch((a) => {
94
+ console.error("获取应用认证页面信息失败:", a);
95
+ });
96
+ }
97
+ return {
98
+ appsData: i,
99
+ appsAuthPageInfoApi: e
100
+ };
101
+ }
102
+ function z(e) {
103
+ return s({
104
+ url: "/restfulApi/auth/signIn",
105
+ method: "post",
106
+ data: e
107
+ });
108
+ }
109
+ function E(e) {
110
+ return s({
111
+ url: "/restfulApi/auth/resetPassword",
112
+ method: "post",
113
+ data: e
114
+ });
115
+ }
116
+ function T(e) {
117
+ return s({
118
+ url: "/restfulApi/auth/signUp",
119
+ method: "post",
120
+ data: e
121
+ });
122
+ }
123
+ function B(e) {
124
+ return s({
125
+ url: "/restfulApi/oauth2/authorize",
126
+ method: "post",
127
+ data: e
128
+ });
129
+ }
130
+ const p = u("signIn"), I = [], A = [], U = [];
131
+ function x(e) {
132
+ I.push(e);
133
+ }
134
+ function C(e) {
135
+ A.push(e);
136
+ }
137
+ function R(e) {
138
+ U.push(e);
139
+ }
140
+ function D() {
141
+ const e = u(!1), t = u(!1), a = u(!1);
142
+ function v(n) {
143
+ e.value = !0, z({
144
+ email: n.email,
145
+ password: n.password
146
+ }).then(({
147
+ data: r
148
+ }) => {
149
+ e.value = !1, localStorage.setItem("jwtToken", r.jwtToken), I.forEach((L) => L(r));
150
+ }).catch((r) => {
151
+ e.value = !1, console.error("登录失败:", r);
152
+ });
153
+ }
154
+ function o(n) {
155
+ t.value = !0, T({
156
+ email: n.email,
157
+ userToken: n.userToken,
158
+ emailVerifyId: n.emailVerifyId,
159
+ password: n.password,
160
+ source: "searchEngine",
161
+ isRecommend: !1
162
+ }).then(() => {
163
+ t.value = !1, p.value = "signIn", A.forEach((r) => r());
164
+ }).catch((r) => {
165
+ t.value = !1, console.error("注册失败:", r);
166
+ });
167
+ }
168
+ function P(n) {
169
+ a.value = !0, E({
170
+ email: n.email,
171
+ userToken: n.userToken,
172
+ emailVerifyId: n.emailVerifyId,
173
+ password: n.password
174
+ }).then(() => {
175
+ a.value = !1, p.value = "signIn", U.forEach((r) => r());
176
+ }).catch((r) => {
177
+ a.value = !1, console.error("重置密码失败:", r);
178
+ });
179
+ }
180
+ function w() {
181
+ p.value = "signUp";
182
+ }
183
+ function y() {
184
+ p.value = "resetPassword";
185
+ }
186
+ function S() {
187
+ p.value = "signIn";
188
+ }
189
+ return {
190
+ signInSubmit: v,
191
+ signUpSubmit: o,
192
+ resetPasswordSubmit: P,
193
+ currentView: p,
194
+ authSignInLoading: e,
195
+ authSignUpLoading: t,
196
+ resetPasswordLoading: a,
197
+ switchSignUp: w,
198
+ switchResetPassword: y,
199
+ switchSignIn: S,
200
+ addSignInCallback: x,
201
+ addSignUpCallback: C,
202
+ addResetPasswordCallback: R
203
+ };
204
+ }
205
+ const j = u(!1);
206
+ function M() {
207
+ return {
208
+ show: j
209
+ };
210
+ }
211
+ function q(e) {
212
+ return s({
213
+ url: "/restfulApi/users/profile",
214
+ method: "post",
215
+ data: e
216
+ });
217
+ }
218
+ function G(e) {
219
+ return s({
220
+ url: "/restfulApi/users/update/baseInfo",
221
+ method: "post",
222
+ data: e
223
+ });
224
+ }
225
+ function H(e) {
226
+ return s({
227
+ url: "/restfulApi/users/update/email",
228
+ method: "post",
229
+ data: e
230
+ });
231
+ }
232
+ function J(e) {
233
+ return s({
234
+ url: "/restfulApi/users/update/password",
235
+ method: "post",
236
+ data: e
237
+ });
238
+ }
239
+ function N() {
240
+ return s({
241
+ url: "/restfulApi/users//unbind/email",
242
+ method: "post"
243
+ });
244
+ }
245
+ const g = u(null), m = u(!1);
246
+ async function $() {
247
+ m.value = !0;
248
+ try {
249
+ const {
250
+ data: e
251
+ } = await q();
252
+ e ? g.value = e : console.warn("获取用户资料返回空数据");
253
+ } catch (e) {
254
+ console.error("获取用户资料失败:", e), g.value = null;
255
+ } finally {
256
+ m.value = !1;
257
+ }
258
+ }
259
+ function Q() {
260
+ return {
261
+ userProfile: g,
262
+ loading: m,
263
+ fetchUserProfile: $
264
+ };
265
+ }
266
+ const l = u(""), d = u("/api"), f = u(""), c = u(""), h = u("ap-beijing");
267
+ function k() {
268
+ const e = [], t = [];
269
+ return l.value || (e.push("appId"), t.push("appId is required for Authkit")), c.value || (e.push("bucketId"), t.push("bucketId is required for Authkit")), f.value || (e.push("bucket"), t.push("bucket is required for Authkit")), l.value && !/^[a-zA-Z0-9]{24}$/.test(l.value) && t.push("appId format is invalid (should be 24 character alphanumeric)"), c.value && !/^[a-zA-Z0-9]{24}$/.test(c.value) && t.push("bucketId format is invalid (should be 24 character alphanumeric)"), {
270
+ isValid: e.length === 0 && t.length === 0,
271
+ missingFields: e,
272
+ errors: t
273
+ };
274
+ }
275
+ function W() {
276
+ const e = b(() => k()), t = b(() => ({
277
+ appId: l.value,
278
+ prefixUrl: d.value,
279
+ bucket: f.value,
280
+ bucketId: c.value,
281
+ region: h.value
282
+ }));
283
+ function a(o) {
284
+ o.appId !== void 0 && (l.value = o.appId), o.prefixUrl !== void 0 && (d.value = o.prefixUrl), o.bucket !== void 0 && (f.value = o.bucket), o.bucketId !== void 0 && (c.value = o.bucketId), o.region !== void 0 && (h.value = o.region);
285
+ }
286
+ function v() {
287
+ const o = k();
288
+ if (!o.isValid)
289
+ throw new Error(`Authkit configuration incomplete: ${o.errors.join(", ")}`);
290
+ return {
291
+ appId: l.value,
292
+ prefixUrl: d.value,
293
+ bucket: f.value,
294
+ bucketId: c.value,
295
+ region: h.value
296
+ };
297
+ }
298
+ return {
299
+ // 原有的 ref 访问方式(向后兼容)
300
+ appId: l,
301
+ prefixUrl: d,
302
+ bucket: f,
303
+ bucketId: c,
304
+ region: h,
305
+ // 新增的类型安全功能
306
+ config: t,
307
+ validation: e,
308
+ setConfig: a,
309
+ getRequiredConfig: v
310
+ };
311
+ }
312
+ export {
313
+ Z as U,
314
+ Q as a,
315
+ M as b,
316
+ W as c,
317
+ O as d,
318
+ q as e,
319
+ G as f,
320
+ J as g,
321
+ H as h,
322
+ N as i,
323
+ B as o,
324
+ D as u
325
+ };