@huyooo/ui 0.5.10 → 0.5.13
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.
- package/dist/{AuthkitAuthModal-DEVS8XfG.js → AuthkitAuthModal-C2KKx46o.js} +324 -300
- package/dist/{AuthkitAuthorize-cnC-Hl0X.js → AuthkitAuthorize-CrmwggKL.js} +1 -1
- package/dist/{ReferrerReferees-D3qUZ62t.js → ReferrerReferees-Bn3bKc0N.js} +1 -1
- package/dist/{UserAccountMenu-50CxuyL3.js → UserAccountMenu-CjajHECj.js} +1 -1
- package/dist/{UserPanel-DHXkFUTF.js → UserPanel-DzSB8_xh.js} +3 -3
- package/dist/{WidthContainer-D_dX_G8P.js → WidthContainer-De_u7Esj.js} +3 -3
- package/dist/api/Authkit/auth.d.ts +1 -0
- package/dist/authkit.js +3 -3
- package/dist/common.js +1 -1
- package/dist/composables.js +2 -2
- package/dist/index.js +698 -613
- package/dist/main.d.ts +1 -0
- package/dist/referrer.js +1 -1
- package/dist/{useAuthkitUsersProfile-Bi_zM2qG.js → useAuthkitUsersProfile-C0ZRUQ3T.js} +54 -44
- package/dist/{useSEO-CREH71xC.js → useSEO-B28j-WY1.js} +1 -1
- package/dist/user.js +2 -2
- package/dist/utils/authkit.d.ts +7 -0
- package/dist/utils/request.d.ts +2 -0
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
package/dist/referrer.js
CHANGED
|
@@ -1,35 +1,44 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { api as
|
|
1
|
+
import { ref as l, readonly as S, computed as A } from "vue";
|
|
2
|
+
import { api as o } from "@huyooo/api";
|
|
3
3
|
import { g as n } from "./globalConfig-C1YOJcxa.js";
|
|
4
|
-
function
|
|
5
|
-
return
|
|
4
|
+
function T(e) {
|
|
5
|
+
return o({
|
|
6
6
|
url: `${n.authPrefixUrl}/restfulApi/auth/signIn`,
|
|
7
7
|
method: "post",
|
|
8
8
|
data: e
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return
|
|
11
|
+
function b(e) {
|
|
12
|
+
return o({
|
|
13
13
|
url: `${n.authPrefixUrl}/restfulApi/auth/resetPassword`,
|
|
14
14
|
method: "post",
|
|
15
15
|
data: e
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
function x(e) {
|
|
19
|
-
return
|
|
19
|
+
return o({
|
|
20
20
|
url: `${n.authPrefixUrl}/restfulApi/auth/signUp`,
|
|
21
21
|
method: "post",
|
|
22
22
|
data: e
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
function G(e) {
|
|
26
|
-
return
|
|
26
|
+
return o({
|
|
27
27
|
url: `${n.authPrefixUrl}/restfulApi/oauth2/authorize`,
|
|
28
28
|
method: "post",
|
|
29
29
|
data: e
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
function H(e) {
|
|
33
|
+
return o({
|
|
34
|
+
url: "/restfulApi/auth/refresh",
|
|
35
|
+
method: "post",
|
|
36
|
+
data: {
|
|
37
|
+
refreshToken: e
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const c = l("signIn"), g = [], m = [], w = [], i = l(null);
|
|
33
42
|
function y() {
|
|
34
43
|
try {
|
|
35
44
|
const e = localStorage.getItem("jwtToken");
|
|
@@ -54,8 +63,8 @@ function p(e) {
|
|
|
54
63
|
i.value = e;
|
|
55
64
|
try {
|
|
56
65
|
localStorage.setItem("jwtToken", e);
|
|
57
|
-
} catch (
|
|
58
|
-
console.warn("Failed to save token to localStorage:",
|
|
66
|
+
} catch (s) {
|
|
67
|
+
console.warn("Failed to save token to localStorage:", s);
|
|
59
68
|
}
|
|
60
69
|
}
|
|
61
70
|
function C() {
|
|
@@ -76,9 +85,9 @@ function V(e) {
|
|
|
76
85
|
w.push(e);
|
|
77
86
|
}
|
|
78
87
|
function F() {
|
|
79
|
-
const e =
|
|
88
|
+
const e = l(!1), s = l(!1), f = l(!1);
|
|
80
89
|
function h(r) {
|
|
81
|
-
e.value = !0,
|
|
90
|
+
e.value = !0, T({
|
|
82
91
|
email: r.email,
|
|
83
92
|
password: r.password
|
|
84
93
|
}).then(({
|
|
@@ -89,21 +98,21 @@ function F() {
|
|
|
89
98
|
e.value = !1, console.error("登录失败:", t);
|
|
90
99
|
});
|
|
91
100
|
}
|
|
92
|
-
function
|
|
93
|
-
|
|
101
|
+
function a(r) {
|
|
102
|
+
s.value = !0, x({
|
|
94
103
|
email: r.email,
|
|
95
104
|
userToken: r.userToken,
|
|
96
105
|
emailVerifyId: r.emailVerifyId,
|
|
97
106
|
password: r.password,
|
|
98
107
|
referrerId: r.referrerId
|
|
99
108
|
}).then(() => {
|
|
100
|
-
|
|
109
|
+
s.value = !1, c.value = "signIn", m.forEach((t) => t());
|
|
101
110
|
}).catch((t) => {
|
|
102
|
-
|
|
111
|
+
s.value = !1, console.error("注册失败:", t);
|
|
103
112
|
});
|
|
104
113
|
}
|
|
105
114
|
function v(r) {
|
|
106
|
-
f.value = !0,
|
|
115
|
+
f.value = !0, b({
|
|
107
116
|
email: r.email,
|
|
108
117
|
userToken: r.userToken,
|
|
109
118
|
emailVerifyId: r.emailVerifyId,
|
|
@@ -125,11 +134,11 @@ function F() {
|
|
|
125
134
|
}
|
|
126
135
|
return {
|
|
127
136
|
signInSubmit: h,
|
|
128
|
-
signUpSubmit:
|
|
137
|
+
signUpSubmit: a,
|
|
129
138
|
resetPasswordSubmit: v,
|
|
130
139
|
currentView: c,
|
|
131
140
|
authSignInLoading: e,
|
|
132
|
-
authSignUpLoading:
|
|
141
|
+
authSignUpLoading: s,
|
|
133
142
|
resetPasswordLoading: f,
|
|
134
143
|
switchSignUp: k,
|
|
135
144
|
switchResetPassword: U,
|
|
@@ -146,68 +155,68 @@ function F() {
|
|
|
146
155
|
};
|
|
147
156
|
}
|
|
148
157
|
function L(e) {
|
|
149
|
-
return console.log(n.authPrefixUrl, "globalConfig.authPrefixUrl"),
|
|
158
|
+
return console.log(n.authPrefixUrl, "globalConfig.authPrefixUrl"), o({
|
|
150
159
|
url: `${n.authPrefixUrl}/restfulApi/users/profile`,
|
|
151
160
|
method: "post",
|
|
152
161
|
data: e
|
|
153
162
|
});
|
|
154
163
|
}
|
|
155
|
-
function
|
|
156
|
-
return
|
|
164
|
+
function J(e) {
|
|
165
|
+
return o({
|
|
157
166
|
url: `${n.authPrefixUrl}/restfulApi/users/update/baseInfo`,
|
|
158
167
|
method: "post",
|
|
159
168
|
data: e
|
|
160
169
|
});
|
|
161
170
|
}
|
|
162
|
-
function
|
|
163
|
-
return
|
|
171
|
+
function K(e) {
|
|
172
|
+
return o({
|
|
164
173
|
url: `${n.authPrefixUrl}/restfulApi/users/update/email`,
|
|
165
174
|
method: "post",
|
|
166
175
|
data: e
|
|
167
176
|
});
|
|
168
177
|
}
|
|
169
|
-
function
|
|
170
|
-
return
|
|
178
|
+
function M(e) {
|
|
179
|
+
return o({
|
|
171
180
|
url: `${n.authPrefixUrl}/restfulApi/users/update/password`,
|
|
172
181
|
method: "post",
|
|
173
182
|
data: e
|
|
174
183
|
});
|
|
175
184
|
}
|
|
176
|
-
function
|
|
177
|
-
return
|
|
185
|
+
function O() {
|
|
186
|
+
return o({
|
|
178
187
|
url: `${n.authPrefixUrl}/restfulApi/users//unbind/email`,
|
|
179
188
|
method: "post"
|
|
180
189
|
});
|
|
181
190
|
}
|
|
182
|
-
const
|
|
191
|
+
const u = l(null), d = l(!1), z = A(() => !!u.value);
|
|
183
192
|
async function R() {
|
|
184
193
|
var h;
|
|
185
194
|
const {
|
|
186
195
|
getToken: e,
|
|
187
|
-
clearAuth:
|
|
196
|
+
clearAuth: s
|
|
188
197
|
} = F();
|
|
189
198
|
if (!e()) {
|
|
190
|
-
console.warn("No authentication token found"),
|
|
199
|
+
console.warn("No authentication token found"), u.value = null;
|
|
191
200
|
return;
|
|
192
201
|
}
|
|
193
202
|
d.value = !0;
|
|
194
203
|
try {
|
|
195
204
|
const {
|
|
196
|
-
data:
|
|
205
|
+
data: a
|
|
197
206
|
} = await L();
|
|
198
|
-
|
|
199
|
-
} catch (
|
|
200
|
-
console.error("获取用户资料失败:",
|
|
207
|
+
a ? u.value = a : (console.warn("获取用户资料返回空数据"), u.value = null);
|
|
208
|
+
} catch (a) {
|
|
209
|
+
console.error("获取用户资料失败:", a), ((h = a == null ? void 0 : a.response) == null ? void 0 : h.status) === 401 && (console.warn("认证已过期,清除认证状态"), s()), u.value = null;
|
|
201
210
|
} finally {
|
|
202
211
|
d.value = !1;
|
|
203
212
|
}
|
|
204
213
|
}
|
|
205
214
|
function B() {
|
|
206
|
-
|
|
215
|
+
u.value = null;
|
|
207
216
|
}
|
|
208
|
-
function
|
|
217
|
+
function Q() {
|
|
209
218
|
return {
|
|
210
|
-
userProfile:
|
|
219
|
+
userProfile: u,
|
|
211
220
|
loading: d,
|
|
212
221
|
isLoggedIn: z,
|
|
213
222
|
// 新增:基于userProfile的登录状态
|
|
@@ -217,12 +226,13 @@ function O() {
|
|
|
217
226
|
};
|
|
218
227
|
}
|
|
219
228
|
export {
|
|
220
|
-
|
|
229
|
+
Q as a,
|
|
221
230
|
L as b,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
231
|
+
J as c,
|
|
232
|
+
M as d,
|
|
233
|
+
K as e,
|
|
234
|
+
O as f,
|
|
226
235
|
G as o,
|
|
236
|
+
H as r,
|
|
227
237
|
F as u
|
|
228
238
|
};
|
|
@@ -9,7 +9,7 @@ import "@arco-design/web-vue";
|
|
|
9
9
|
import "./useUploadCos-D5k1YLb7.js";
|
|
10
10
|
import "@huyooo/api";
|
|
11
11
|
import "./AuthkitAuthModal.vue_vue_type_style_index_1_lang-BpOmabWi.js";
|
|
12
|
-
import { a as E } from "./useAuthkitUsersProfile-
|
|
12
|
+
import { a as E } from "./useAuthkitUsersProfile-C0ZRUQ3T.js";
|
|
13
13
|
import "@iconify/vue";
|
|
14
14
|
/* empty css */
|
|
15
15
|
import { u as O } from "./useAuthkitAppsAuthPageInfo-Dfj4byB5.js";
|
package/dist/user.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { U as r, a as e, b as o, c as n, S as t } from "./UserPanel-
|
|
2
|
-
import { U as c } from "./UserAccountMenu-
|
|
1
|
+
import { U as r, a as e, b as o, c as n, S as t } from "./UserPanel-DzSB8_xh.js";
|
|
2
|
+
import { U as c } from "./UserAccountMenu-CjajHECj.js";
|
|
3
3
|
export {
|
|
4
4
|
c as UserAccountMenu,
|
|
5
5
|
r as UserAvatar,
|
package/dist/utils/authkit.d.ts
CHANGED
|
@@ -6,3 +6,10 @@ export declare function findLabel(options: Array<{
|
|
|
6
6
|
label: string;
|
|
7
7
|
} | undefined;
|
|
8
8
|
export declare function hideEmail(email: string, prefixLength?: number): string;
|
|
9
|
+
export declare function clearAuth(): void;
|
|
10
|
+
export declare function setAuth(tokens: {
|
|
11
|
+
jwtToken: string;
|
|
12
|
+
refreshToken: string;
|
|
13
|
+
}): void;
|
|
14
|
+
export declare function getRefreshToken(): string | null;
|
|
15
|
+
export declare function updateJwtToken(jwtToken: string): void;
|