@huyooo/ui 0.7.20 → 0.7.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.
- package/dist/{AuthkitAuthModal-DxxZlUbh.js → AuthkitAuthModal-DcZ69VKT.js} +670 -685
- package/dist/{AuthkitSignInPhone-BfqNvheZ.js → AuthkitSignInPhone-CJLeElZ1.js} +224 -232
- package/dist/{Clipboard-C_4QFg2W.js → Clipboard-BVSUEtX_.js} +2 -2
- package/dist/{Contact-DJtDuS50.js → Contact-DWQjd6yu.js} +2 -2
- package/dist/{FeedbackItem-CI-w_fOt.js → FeedbackItem-qppn-rOs.js} +3 -3
- package/dist/{FeedbackModal-3k-cMuoY.js → FeedbackModal-28L6QJaB.js} +329 -342
- package/dist/{MessageHandle-Pxxvhs-7.js → MessageHandle-DaczDI82.js} +212 -236
- package/dist/{MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-BVvzvLUA.js → MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-DHO6VGx-.js} +26 -28
- package/dist/{MessageNotifications-FkiOW4qU.js → MessageNotifications-IluYhczu.js} +1 -1
- package/dist/{PaySubscriptions-BHTKDYFN.js → PaySubscriptions-BqtXFPHR.js} +50 -74
- package/dist/{ReferrerReferees-9wk0_tGC.js → ReferrerReferees-D6CNoqs4.js} +30 -32
- package/dist/{Upload.vue_vue_type_script_setup_true_lang-RZzfS9p1.js → Upload.vue_vue_type_script_setup_true_lang-D2gY_z-p.js} +1 -1
- package/dist/{UserAccountMenu-CKGTR8GB.js → UserAccountMenu--fY2QkYw.js} +7 -7
- package/dist/{WidthContainer-BC30d-AV.js → WidthContainer-DMJSBs_q.js} +7 -7
- package/dist/api/Authkit/Users.d.ts +7 -7
- package/dist/api/Authkit/apps.d.ts +2 -2
- package/dist/api/Authkit/auth.d.ts +10 -10
- package/dist/api/Authkit/oauth.d.ts +3 -3
- package/dist/api/Authkit/verify.d.ts +18 -5
- package/dist/api/Buckets/Files.d.ts +7 -7
- package/dist/api/Buckets.d.ts +2 -2
- package/dist/api/Invoices.d.ts +6 -6
- package/dist/api/Message/ChangelogNotifications.d.ts +2 -31
- package/dist/api/Message/EventNotifications.d.ts +2 -35
- package/dist/api/Message/MessageNotifications.d.ts +5 -35
- package/dist/api/Message/NoticeNotifications.d.ts +5 -42
- package/dist/api/Messages.d.ts +2 -2
- package/dist/api/Orders.d.ts +9 -9
- package/dist/api/Products.d.ts +6 -6
- package/dist/api/Quotas.d.ts +6 -6
- package/dist/api/Referrer.d.ts +1 -1
- package/dist/api/Subscriptions.d.ts +7 -7
- package/dist/api/index.d.ts +8 -8
- package/dist/authkit.js +6 -6
- package/dist/common.js +1 -1
- package/dist/composables/Authkit/useAuthkitAppsAuthPageInfo.d.ts +1 -1
- package/dist/composables/Authkit/useAuthkitAuth.d.ts +3 -3
- package/dist/composables/useMessageNotifications.d.ts +3 -3
- package/dist/composables.js +9 -9
- package/dist/feedback.js +3 -3
- package/dist/index.js +24 -24
- package/dist/message.js +3 -3
- package/dist/pay.js +1 -1
- package/dist/privateCom.js +1 -1
- package/dist/referrer.js +1 -1
- package/dist/request-BkNyIDws.js +196 -0
- package/dist/style.css +1 -1
- package/dist/upload.js +2 -2
- package/dist/{useAuthkitAppsAuthPageInfo-AFq46sfo.js → useAuthkitAppsAuthPageInfo-Bu-Q-44G.js} +17 -19
- package/dist/{useAuthkitCreateAndUpdate-BZXteclG.js → useAuthkitCreateAndUpdate-DHGgpk14.js} +1 -1
- package/dist/useAuthkitUsersProfile-D58I5n2T.js +257 -0
- package/dist/{useDownloads-2DzDw0ic.js → useDownloads-jzTsK6S6.js} +1 -1
- package/dist/useMessageNotifications-CLowHpNV.js +78 -0
- package/dist/{useSEO-BmD-Tu3B.js → useSEO-Curqg3Re.js} +2 -2
- package/dist/{useTableHandle-SmqaOxbN.js → useTableHandle-MuavycJ7.js} +1 -1
- package/dist/{useUploadCos-8imaHXLO.js → useUploadCos-C4mpMNhT.js} +10 -7
- package/dist/user.js +1 -1
- package/dist/utils/request.d.ts +25 -2
- package/package.json +1 -1
- package/dist/auth-CfexrvhT.js +0 -188
- package/dist/useAuthkitUsersProfile-B26kPQrp.js +0 -234
- package/dist/useMessageNotifications-DiF1CPlT.js +0 -84
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { Message as u } from "@arco-design/web-vue";
|
|
3
|
+
import R from "axios";
|
|
4
|
+
import { ref as I } from "vue";
|
|
5
|
+
function B(e, r = 3) {
|
|
6
|
+
const t = e.indexOf("@");
|
|
7
|
+
if (t > 1) {
|
|
8
|
+
const a = e.slice(0, r), l = e.slice(t);
|
|
9
|
+
return a + "***" + l;
|
|
10
|
+
}
|
|
11
|
+
return e;
|
|
12
|
+
}
|
|
13
|
+
function b() {
|
|
14
|
+
try {
|
|
15
|
+
localStorage.removeItem("jwtToken"), localStorage.removeItem("refreshToken");
|
|
16
|
+
} catch (e) {
|
|
17
|
+
console.warn("Failed to clear localStorage:", e);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function T() {
|
|
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 o = {
|
|
35
|
+
appId: "",
|
|
36
|
+
onesPrefixUrl: "/restfulApi",
|
|
37
|
+
authPrefixUrl: "",
|
|
38
|
+
billingPrefixUrl: "/billingApi",
|
|
39
|
+
oauthCallbackUrl: "",
|
|
40
|
+
avatarBucketId: "68350c206888f565dc7d09e9",
|
|
41
|
+
feedbackBucketId: "6826e4db6888f565dc775dce",
|
|
42
|
+
bucket: "ones-1358549778",
|
|
43
|
+
region: "ap-beijing",
|
|
44
|
+
web3formsAccessKey: "72604aac-d55e-4df0-9bcf-31b2206b3753"
|
|
45
|
+
}, O = {};
|
|
46
|
+
function D(e) {
|
|
47
|
+
Object.assign(O, e);
|
|
48
|
+
}
|
|
49
|
+
function N(e) {
|
|
50
|
+
o.appId = e.appId, o.authPrefixUrl = e.authPrefixUrl, e.onesPrefixUrl !== void 0 && (o.onesPrefixUrl = e.onesPrefixUrl), e.billingPrefixUrl !== void 0 && (o.billingPrefixUrl = e.billingPrefixUrl), e.oauthCallbackUrl !== void 0 ? o.oauthCallbackUrl = e.oauthCallbackUrl : typeof window < "u" && (o.oauthCallbackUrl = `${window.location.origin}/auth/callback`), e.avatarBucketId !== void 0 && (o.avatarBucketId = e.avatarBucketId), e.feedbackBucketId !== void 0 && (o.feedbackBucketId = e.feedbackBucketId), e.bucket !== void 0 && (o.bucket = e.bucket), e.region !== void 0 && (o.region = e.region), e.web3formsAccessKey !== void 0 && (o.web3formsAccessKey = e.web3formsAccessKey);
|
|
51
|
+
}
|
|
52
|
+
const U = I(!1);
|
|
53
|
+
function P() {
|
|
54
|
+
return {
|
|
55
|
+
show: U
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const S = 18e5, d = 40101, s = {
|
|
59
|
+
CONFIG_ERROR: "请求配置错误",
|
|
60
|
+
NETWORK_ERROR: "网络错误,请检查网络连接",
|
|
61
|
+
SERVICE_ERROR: "服务错误",
|
|
62
|
+
REQUEST_ERROR: "请求错误",
|
|
63
|
+
REQUEST_FAILED: "请求失败",
|
|
64
|
+
LOGIN_EXPIRED: "登录已过期,请重新登录"
|
|
65
|
+
};
|
|
66
|
+
function g(e) {
|
|
67
|
+
return {
|
|
68
|
+
data: e,
|
|
69
|
+
error: null
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function n(e, r) {
|
|
73
|
+
return {
|
|
74
|
+
data: null,
|
|
75
|
+
error: {
|
|
76
|
+
code: e,
|
|
77
|
+
message: r
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
let i = !1, f = [];
|
|
82
|
+
function k(e, r = null) {
|
|
83
|
+
f.forEach(({
|
|
84
|
+
resolve: t,
|
|
85
|
+
reject: a
|
|
86
|
+
}) => {
|
|
87
|
+
e ? a(e) : t(r);
|
|
88
|
+
}), f = [];
|
|
89
|
+
}
|
|
90
|
+
async function _() {
|
|
91
|
+
var r;
|
|
92
|
+
const e = T();
|
|
93
|
+
if (!e)
|
|
94
|
+
throw new Error("No refresh token available");
|
|
95
|
+
try {
|
|
96
|
+
const t = await R.post(`${o.authPrefixUrl}/auth/refresh`, {
|
|
97
|
+
refreshToken: e
|
|
98
|
+
}), {
|
|
99
|
+
data: a
|
|
100
|
+
} = t;
|
|
101
|
+
if (a.success && ((r = a.data) != null && r.jwtToken))
|
|
102
|
+
return m(a.data.jwtToken), a.data.refreshToken && localStorage.setItem("refreshToken", a.data.refreshToken), a.data.jwtToken;
|
|
103
|
+
throw new Error(a.message || "Token refresh failed");
|
|
104
|
+
} catch (t) {
|
|
105
|
+
throw console.error("Token refresh failed:", t), t;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async function x(e) {
|
|
109
|
+
if (i)
|
|
110
|
+
return new Promise((r) => {
|
|
111
|
+
f.push({
|
|
112
|
+
resolve: async (t) => {
|
|
113
|
+
e.headers && typeof t == "string" && (e.headers.authorization = `Bearer ${t}`);
|
|
114
|
+
const a = await c(e);
|
|
115
|
+
r(a);
|
|
116
|
+
},
|
|
117
|
+
reject: () => {
|
|
118
|
+
r(n(d, s.LOGIN_EXPIRED));
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
e._retry = !0, i = !0;
|
|
123
|
+
try {
|
|
124
|
+
const r = await _();
|
|
125
|
+
return k(null, r), e.headers && (e.headers.authorization = `Bearer ${r}`), await c(e);
|
|
126
|
+
} catch (r) {
|
|
127
|
+
k(r, null), b();
|
|
128
|
+
const {
|
|
129
|
+
show: t
|
|
130
|
+
} = P();
|
|
131
|
+
return t.value = !0, u.error(s.LOGIN_EXPIRED), n(d, s.LOGIN_EXPIRED);
|
|
132
|
+
} finally {
|
|
133
|
+
i = !1;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function y(e) {
|
|
137
|
+
if (e.response) {
|
|
138
|
+
const {
|
|
139
|
+
data: r,
|
|
140
|
+
status: t
|
|
141
|
+
} = e.response, a = (r == null ? void 0 : r.message) || s.SERVICE_ERROR;
|
|
142
|
+
return {
|
|
143
|
+
code: t,
|
|
144
|
+
message: a
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
return e.request ? {
|
|
148
|
+
code: -1,
|
|
149
|
+
message: s.NETWORK_ERROR
|
|
150
|
+
} : {
|
|
151
|
+
code: -1,
|
|
152
|
+
message: e.message || s.REQUEST_ERROR
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
const c = R.create({
|
|
156
|
+
timeout: S,
|
|
157
|
+
headers: {
|
|
158
|
+
"Content-Type": "application/json"
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
c.interceptors.request.use((e) => {
|
|
162
|
+
const r = localStorage.getItem("jwtToken");
|
|
163
|
+
return r && e.headers && (e.headers.authorization = `Bearer ${r}`), e.headers && !("app-id" in e.headers) && (e.headers["app-id"] = o.appId), e;
|
|
164
|
+
}, () => Promise.resolve(n(-1, s.CONFIG_ERROR)));
|
|
165
|
+
c.interceptors.response.use(async (e) => {
|
|
166
|
+
const r = (e == null ? void 0 : e.data) || {}, {
|
|
167
|
+
message: t,
|
|
168
|
+
success: a,
|
|
169
|
+
code: l,
|
|
170
|
+
data: h
|
|
171
|
+
} = r;
|
|
172
|
+
if (a)
|
|
173
|
+
return g(h);
|
|
174
|
+
if (l === d) {
|
|
175
|
+
const p = e.config;
|
|
176
|
+
return x(p);
|
|
177
|
+
}
|
|
178
|
+
const E = t || s.REQUEST_FAILED;
|
|
179
|
+
return u.error(E), n(l || -1, E);
|
|
180
|
+
}, (e) => {
|
|
181
|
+
const {
|
|
182
|
+
code: r,
|
|
183
|
+
message: t
|
|
184
|
+
} = y(e);
|
|
185
|
+
return u.error(t), n(r, t);
|
|
186
|
+
});
|
|
187
|
+
const G = c;
|
|
188
|
+
export {
|
|
189
|
+
O as a,
|
|
190
|
+
D as b,
|
|
191
|
+
G as c,
|
|
192
|
+
o as g,
|
|
193
|
+
B as h,
|
|
194
|
+
N as s,
|
|
195
|
+
P as u
|
|
196
|
+
};
|