@huyooo/ui 0.15.0 → 0.15.2

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-Xe-QQSQ4.js → AuthkitAppSetting-Ds7mYFV5.js} +6 -6
  2. package/dist/{AuthkitGithubBinding-Uya3rVdX.js → AuthkitGithubBinding-LVDS1PNQ.js} +231 -228
  3. package/dist/{Clipboard-C8ncjaAJ.js → Clipboard-R3AURqvU.js} +1 -1
  4. package/dist/{Contact-mb7deQOs.js → Contact-B3AMSHoN.js} +2 -2
  5. package/dist/{FeedbackItem-C4MZUC-3.js → FeedbackItem-DkvSQT33.js} +3 -3
  6. package/dist/{FeedbackModal-yVKcsuaE.js → FeedbackModal-C45pNoiw.js} +3 -3
  7. package/dist/{MessageHandle-rRAQnE-q.js → MessageHandle-CEQtGyVZ.js} +2 -2
  8. package/dist/{MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-CsXEBH4f.js → MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-87v_RIQa.js} +2 -2
  9. package/dist/{PaySubscriptions-B6R71CHm.js → PaySubscriptions-D3g1OhiA.js} +4 -4
  10. package/dist/{PricingPlans-Ddl98xpp.js → PricingPlans-DXea7rl0.js} +79 -80
  11. package/dist/{ReferrerReferees-DFCwvXJ6.js → ReferrerReferees-BxmZ1w_L.js} +4 -4
  12. package/dist/{Upload.vue_vue_type_script_setup_true_lang-dLSky4Yx.js → Upload.vue_vue_type_script_setup_true_lang-DLKSHzxG.js} +1 -1
  13. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-f2mzNg6i.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-C7mV8kGe.js} +9 -9
  14. package/dist/{WidthContainer-DSxG-FRN.js → WidthContainer-DKasAIgU.js} +9 -9
  15. package/dist/{apiClients-CkI47p36.js → apiClients-DT7o0IpO.js} +124 -109
  16. package/dist/authkit.js +9 -9
  17. package/dist/common.js +1 -1
  18. package/dist/composables/Billing/useBillingPlans.d.ts +1 -19
  19. package/dist/composables.js +13 -13
  20. package/dist/feedback.js +3 -3
  21. package/dist/main.d.ts +1 -0
  22. package/dist/main.js +248 -243
  23. package/dist/message.js +3 -3
  24. package/dist/pay.js +4 -4
  25. package/dist/privateCom.js +1 -1
  26. package/dist/referrer.js +1 -1
  27. package/dist/style.css +1 -1
  28. package/dist/types/api/billing.generated.d.ts +2 -6
  29. package/dist/types/api/log.generated.d.ts +4 -2
  30. package/dist/upload.js +2 -2
  31. package/dist/{useAuthkitAppsAuthPageInfo-nCjfAjiw.js → useAuthkitAppsAuthPageInfo-DScDQfj5.js} +1 -1
  32. package/dist/{useAuthkitAuth-C--qS6UE.js → useAuthkitAuth-DpdKRuJm.js} +65 -67
  33. package/dist/{useAuthkitCreateAndUpdate-u-ceTc-m.js → useAuthkitCreateAndUpdate-MzA4qtTh.js} +1 -1
  34. package/dist/{useAuthkitUsersProfile-BC5EsA2f.js → useAuthkitUsersProfile-aw_A7IWb.js} +2 -2
  35. package/dist/{useBillingStatusOptions-D5Ehwtbj.js → useBillingStatusOptions-CAsu1hrf.js} +3 -3
  36. package/dist/{useEnsureAuthenticated-C4tsSfv6.js → useEnsureAuthenticated-BEKhtQAl.js} +2 -2
  37. package/dist/{useLegalLinks-DeXLE-yv.js → useLegalLinks-BijRF_ZD.js} +2 -2
  38. package/dist/{useMessageNotifications-BMUx5xfX.js → useMessageNotifications-CFku0c2R.js} +1 -1
  39. package/dist/{useRoutePermission-CxRJlooW.js → useRoutePermission-v4_0B-aO.js} +2 -2
  40. package/dist/{useSEO-DFmbAH-7.js → useSEO-CbHCw4gq.js} +1 -1
  41. package/dist/{useSubscriptionCheckout-CHAF20s-.js → useSubscriptionCheckout-BjPiHSjA.js} +103 -104
  42. package/dist/{useTableHandle-9alnSWt0.js → useTableHandle-TDJa_Czn.js} +1 -1
  43. package/dist/{useUploadCos-DGPnLOC9.js → useUploadCos-CvG6EL5Q.js} +1 -1
  44. package/dist/user.js +1 -1
  45. package/dist/utils/apiMiddlewares.d.ts +3 -0
  46. package/dist/utils/authkit.d.ts +6 -0
  47. package/package.json +2 -2
@@ -1,19 +1,19 @@
1
- import { ref as y, computed as q } from "vue";
2
- import { d as J } from "./useBillingStatusOptions-D5Ehwtbj.js";
3
- import { f as I } from "./apiClients-CkI47p36.js";
1
+ import { ref as y, computed as L } from "vue";
2
+ import { d as H } from "./useBillingStatusOptions-CAsu1hrf.js";
3
+ import { h as $ } from "./apiClients-DT7o0IpO.js";
4
4
  /* empty css */
5
5
  import { Message as g } from "@arco-design/web-vue";
6
- import { u as N } from "./useEnsureAuthenticated-C4tsSfv6.js";
7
- function x(e) {
6
+ import { u as J } from "./useEnsureAuthenticated-BEKhtQAl.js";
7
+ function M(e) {
8
8
  var i;
9
9
  const r = (i = e == null ? void 0 : e.metadata) == null ? void 0 : i.originalPrice;
10
10
  return typeof r == "number" ? r : void 0;
11
11
  }
12
- function W(e) {
13
- const r = x(e);
12
+ function N(e) {
13
+ const r = M(e);
14
14
  return !e || r === void 0 || r <= e.unitAmount ? 0 : Math.round((1 - e.unitAmount / r) * 100);
15
15
  }
16
- function X(e) {
16
+ function W(e) {
17
17
  var l, f;
18
18
  const r = (l = e == null ? void 0 : e.metadata) == null ? void 0 : l.discountLabel;
19
19
  if (typeof r == "string" && r.trim())
@@ -21,10 +21,10 @@ function X(e) {
21
21
  const i = (f = e == null ? void 0 : e.metadata) == null ? void 0 : f.savingMonths;
22
22
  return typeof i == "number" && i > 0 ? `买 ${12 - i} 个月送 ${i} 个月` : "";
23
23
  }
24
- function S(e) {
24
+ function q(e) {
25
25
  return e === void 0 ? 0 : Math.floor(e / 100);
26
26
  }
27
- function Y(e, r = 1) {
27
+ function X(e, r = 1) {
28
28
  const i = r > 1 ? `每 ${r} ` : "按";
29
29
  switch (e) {
30
30
  case "month":
@@ -39,7 +39,7 @@ function Y(e, r = 1) {
39
39
  return "";
40
40
  }
41
41
  }
42
- function Z(e) {
42
+ function Y(e) {
43
43
  const r = e != null && e.intervalCount && e.intervalCount > 1 ? `${e.intervalCount} ` : "";
44
44
  switch (e == null ? void 0 : e.interval) {
45
45
  case "month":
@@ -54,7 +54,7 @@ function Z(e) {
54
54
  return "";
55
55
  }
56
56
  }
57
- function w(e) {
57
+ function I(e) {
58
58
  switch (e) {
59
59
  case "day":
60
60
  return "每天";
@@ -70,25 +70,25 @@ function w(e) {
70
70
  return "";
71
71
  }
72
72
  }
73
- function B(e) {
73
+ function S(e) {
74
74
  if (e.type === "quota" && e.value !== void 0) {
75
- const r = w(e.quotaPeriod), i = r ? ` / ${r}` : "";
75
+ const r = I(e.quotaPeriod), i = r ? ` / ${r}` : "";
76
76
  return `${e.name}: ${e.value === -1 ? "无限" : e.value}${i}`;
77
77
  }
78
78
  if (e.type === "unlimited") {
79
- const r = w(e.quotaPeriod);
79
+ const r = I(e.quotaPeriod);
80
80
  return r ? `${e.name}: 不限 / ${r}` : `${e.name}不限`;
81
81
  }
82
82
  return e.type === "boolean" && e.value === !1 ? `${e.name}(不支持)` : e.name;
83
83
  }
84
- function C(e) {
84
+ function w(e) {
85
85
  return e.type !== "recurring" || !e.interval ? null : {
86
86
  key: `${e.interval}:${e.intervalCount ?? 1}`,
87
87
  interval: e.interval,
88
88
  intervalCount: e.intervalCount ?? 1
89
89
  };
90
90
  }
91
- function ee(e, r) {
91
+ function Z(e, r) {
92
92
  const i = {
93
93
  day: 1,
94
94
  week: 2,
@@ -97,58 +97,57 @@ function ee(e, r) {
97
97
  };
98
98
  return i[e.interval] - i[r.interval] || e.intervalCount - r.intervalCount;
99
99
  }
100
- function te(e, r) {
100
+ function ee(e, r) {
101
101
  let i = 0;
102
102
  for (const l of e)
103
103
  for (const f of l.prices) {
104
- const s = C(f);
105
- (s == null ? void 0 : s.key) === r && (i = Math.max(i, W(f)));
104
+ const s = w(f);
105
+ (s == null ? void 0 : s.key) === r && (i = Math.max(i, N(f)));
106
106
  }
107
107
  return i > 0 ? `省 ${i}%` : void 0;
108
108
  }
109
- function ne(e) {
109
+ function te(e) {
110
110
  return e.includes(":") ? e : `${e}:1`;
111
111
  }
112
- function D() {
112
+ function B() {
113
113
  return !!localStorage.getItem("jwtToken");
114
114
  }
115
- function de(e = "month") {
116
- const r = y([]), i = y(null), l = y(null), f = y(!1), s = y(!1), d = y(ne(e)), a = q(() => {
115
+ function fe(e = "month") {
116
+ const r = y([]), i = y(null), l = y(null), f = y(!1), s = y(!1), d = y(te(e)), a = L(() => {
117
117
  const t = /* @__PURE__ */ new Map();
118
118
  for (const n of r.value)
119
119
  for (const u of n.prices) {
120
- const c = C(u);
120
+ const c = w(u);
121
121
  c && t.set(c.key, c);
122
122
  }
123
- return [...t.values()].sort(ee).map((n) => ({
123
+ return [...t.values()].sort(Z).map((n) => ({
124
124
  value: n.key,
125
- label: Y(n.interval, n.intervalCount),
126
- badge: te(r.value, n.key)
125
+ label: X(n.interval, n.intervalCount),
126
+ badge: ee(r.value, n.key)
127
127
  }));
128
- }), b = q(() => {
129
- var n;
128
+ }), p = L(() => {
130
129
  const t = [];
131
- for (const u of r.value) {
132
- const c = u.prices.find((p) => {
133
- const $ = C(p);
134
- return ($ == null ? void 0 : $.key) === d.value;
135
- }), m = u.prices.find((p) => p.type === "free"), o = c ?? (m && u.prices.every((p) => p.type === "free") ? m : void 0);
136
- o && t.push({
137
- ...u,
138
- features: (n = o.features) != null && n.length ? o.features : u.features,
139
- selectedPrice: o
130
+ for (const n of r.value) {
131
+ const u = n.prices.find((o) => {
132
+ const h = w(o);
133
+ return (h == null ? void 0 : h.key) === d.value;
134
+ }), c = n.prices.find((o) => o.type === "free"), m = u ?? (c && n.prices.every((o) => o.type === "free") ? c : void 0);
135
+ m && t.push({
136
+ ...n,
137
+ features: m.features ?? [],
138
+ selectedPrice: m
140
139
  });
141
140
  }
142
141
  return t;
143
142
  });
144
- function F(t) {
143
+ function x(t) {
145
144
  d.value = t;
146
145
  }
147
146
  function P(t) {
148
147
  const n = i.value, u = l.value;
149
148
  return n != null && n.priceId && t.selectedPrice ? n.priceId === t.selectedPrice.id : n ? n.productId === t.id : u != null && u.priceId && t.selectedPrice ? u.priceId === t.selectedPrice.id : u ? u.productId === t.id : !1;
150
149
  }
151
- function k(t) {
150
+ function C(t) {
152
151
  var n;
153
152
  return ((n = i.value) == null ? void 0 : n.productId) === t.id;
154
153
  }
@@ -156,39 +155,39 @@ function de(e = "month") {
156
155
  var n;
157
156
  return ((n = t.selectedPrice) == null ? void 0 : n.type) === "free";
158
157
  }
159
- function U() {
158
+ function F() {
160
159
  return !!i.value;
161
160
  }
162
- function T(t) {
163
- return !!(!t.selectedPrice || P(t) || v(t) && U());
161
+ function U(t) {
162
+ return !!(!t.selectedPrice || P(t) || v(t) && F());
164
163
  }
165
- function h(t) {
164
+ function b(t) {
166
165
  var n;
167
166
  return ((n = t.metadata) == null ? void 0 : n.recommended) === !0;
168
167
  }
169
- function j(t) {
168
+ function T(t) {
170
169
  var n;
171
- return S((n = t.selectedPrice) == null ? void 0 : n.unitAmount);
170
+ return q((n = t.selectedPrice) == null ? void 0 : n.unitAmount);
171
+ }
172
+ function j(t) {
173
+ const n = M(t.selectedPrice);
174
+ return n === void 0 ? void 0 : q(n);
172
175
  }
173
176
  function G(t) {
174
- const n = x(t.selectedPrice);
175
- return n === void 0 ? void 0 : S(n);
177
+ return v(t) ? "" : Y(t.selectedPrice);
176
178
  }
177
179
  function O(t) {
178
- return v(t) ? "" : Z(t.selectedPrice);
179
- }
180
- function R(t) {
181
180
  var n;
182
181
  if (v(t)) {
183
182
  const u = (n = t.selectedPrice) == null ? void 0 : n.trialPeriodDays;
184
183
  return u ? `${u} 天免费体验` : "免费体验";
185
184
  }
186
- return X(t.selectedPrice);
185
+ return W(t.selectedPrice);
187
186
  }
188
- function E(t) {
189
- return P(t) ? "当前方案" : h(t) ? "最受欢迎" : "";
187
+ function R(t) {
188
+ return P(t) ? "当前方案" : b(t) ? "最受欢迎" : "";
190
189
  }
191
- function K(t) {
190
+ function E(t) {
192
191
  const n = [];
193
192
  return P(t) ? n.push({
194
193
  label: "当前方案",
@@ -196,32 +195,32 @@ function de(e = "month") {
196
195
  }) : v(t) ? n.push({
197
196
  label: "免费体验",
198
197
  type: "trial"
199
- }) : h(t) && n.push({
198
+ }) : b(t) && n.push({
200
199
  label: "最受欢迎",
201
200
  type: "recommended"
202
201
  }), n;
203
202
  }
204
- function Q(t) {
203
+ function K(t) {
205
204
  const n = i.value;
206
- return P(t) ? "当前方案" : v(t) ? n ? "已订阅付费方案" : D() ? "免费开通" : "免费注册" : n ? k(t) ? "切换周期" : typeof n.unitAmount == "number" && t.selectedPrice.unitAmount > n.unitAmount ? "升级方案" : "切换方案" : "立即订阅";
205
+ return P(t) ? "当前方案" : v(t) ? n ? "已订阅付费方案" : B() ? "免费开通" : "免费注册" : n ? C(t) ? "切换周期" : typeof n.unitAmount == "number" && t.selectedPrice.unitAmount > n.unitAmount ? "升级方案" : "切换方案" : "立即订阅";
207
206
  }
208
- function V(t, n) {
207
+ function Q(t, n) {
209
208
  const u = t.features.find((c) => c.type === "quota" && c.value !== void 0);
210
209
  if (u) {
211
- const c = w(u.quotaPeriod), m = u.value === -1 ? "不限量" : u.value;
210
+ const c = I(u.quotaPeriod), m = u.value === -1 ? "不限量" : u.value;
212
211
  return `${u.name} ${c ? `${m} / ${c}` : m},覆盖核心使用场景。`;
213
212
  }
214
213
  return v(t) ? "注册后自动开通免费权益,适合先体验核心能力。" : n === 1 ? "为正式团队准备的高配能力组合。" : "包含入门所需的核心能力。";
215
214
  }
216
- function _(t) {
215
+ function V(t) {
217
216
  return t.filter((n) => n.highlight !== !1).map((n) => ({
218
- title: B(n),
217
+ title: S(n),
219
218
  description: n.description || ""
220
219
  }));
221
220
  }
222
- function z(t) {
221
+ function _(t) {
223
222
  const n = t.filter((o) => o.highlight !== !1), u = n.filter((o) => o.type === "quota" || o.type === "unlimited").map((o) => ({
224
- title: B(o),
223
+ title: S(o),
225
224
  description: o.description || ""
226
225
  })), c = n.filter((o) => o.type === "boolean" && o.value !== !1).map((o) => ({
227
226
  title: o.name,
@@ -235,17 +234,17 @@ function de(e = "month") {
235
234
  items: u
236
235
  }), m;
237
236
  }
238
- async function A() {
237
+ async function k() {
239
238
  f.value = !0;
240
239
  try {
241
- const t = await J.productOptions();
240
+ const t = await H.productOptions();
242
241
  r.value = Array.isArray(t) ? t : [], !a.value.some((u) => u.value === d.value) && a.value[0] && (d.value = a.value[0].value);
243
242
  } finally {
244
243
  f.value = !1;
245
244
  }
246
245
  }
247
- async function L() {
248
- if (!D()) {
246
+ async function A() {
247
+ if (!B()) {
249
248
  i.value = null, l.value = null;
250
249
  return;
251
250
  }
@@ -254,7 +253,7 @@ function de(e = "month") {
254
253
  const {
255
254
  data: t,
256
255
  error: n
257
- } = await I.subscriptions.summary.post();
256
+ } = await $.subscriptions.summary.post();
258
257
  if (n) {
259
258
  console.error("加载当前订阅失败", n);
260
259
  return;
@@ -264,55 +263,55 @@ function de(e = "month") {
264
263
  s.value = !1;
265
264
  }
266
265
  }
267
- async function H() {
268
- await Promise.all([A(), L()]);
266
+ async function z() {
267
+ await Promise.all([k(), A()]);
269
268
  }
270
269
  return {
271
270
  products: r,
272
- plans: b,
271
+ plans: p,
273
272
  currentSubscription: i,
274
273
  currentTrial: l,
275
274
  listLoading: f,
276
275
  currentLoading: s,
277
276
  billingInterval: d,
278
277
  billingIntervalTabs: a,
279
- setBillingInterval: F,
278
+ setBillingInterval: x,
280
279
  isCurrentPlan: P,
281
- isSameProduct: k,
282
- isRecommendedPlan: h,
280
+ isSameProduct: C,
281
+ isRecommendedPlan: b,
283
282
  isFreePlan: v,
284
- isPlanActionDisabled: T,
285
- getDisplayPrice: j,
286
- getDisplayOriginalPrice: G,
287
- getDisplayCycle: O,
288
- getPromotionLabel: R,
289
- getBadgeLabel: E,
290
- getBadgeLabels: K,
291
- getButtonLabel: Q,
292
- getPlanSummary: V,
293
- getFeatureItems: _,
294
- getFeatureGroups: z,
295
- loadProducts: A,
296
- loadCurrentSubscription: L,
297
- refresh: H
283
+ isPlanActionDisabled: U,
284
+ getDisplayPrice: T,
285
+ getDisplayOriginalPrice: j,
286
+ getDisplayCycle: G,
287
+ getPromotionLabel: O,
288
+ getBadgeLabel: R,
289
+ getBadgeLabels: E,
290
+ getButtonLabel: K,
291
+ getPlanSummary: Q,
292
+ getFeatureItems: V,
293
+ getFeatureGroups: _,
294
+ loadProducts: k,
295
+ loadCurrentSubscription: A,
296
+ refresh: z
298
297
  };
299
298
  }
300
- function re(e) {
299
+ function ne(e) {
301
300
  window.open(e, "_blank", "noopener,noreferrer");
302
301
  }
303
- function M(e) {
302
+ function D(e) {
304
303
  return e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "";
305
304
  }
306
- function ie(e) {
305
+ function re(e) {
307
306
  return e && typeof e == "object" && "alipayUrl" in e && typeof e.alipayUrl == "string" ? e.alipayUrl : "";
308
307
  }
309
- function ue(e) {
308
+ function ie(e) {
310
309
  return e && typeof e == "object" && "status" in e && e.status === "trialing";
311
310
  }
312
- function me(e) {
311
+ function de(e) {
313
312
  const r = y(null), {
314
313
  ensureAuthenticated: i
315
- } = N();
314
+ } = J();
316
315
  async function l(s) {
317
316
  if (!s.selectedPrice) {
318
317
  g.warning("当前方案暂无可购买价格");
@@ -328,23 +327,23 @@ function me(e) {
328
327
  try {
329
328
  if (s.selectedPrice.type === "free")
330
329
  return;
331
- const a = d ? await I.subscriptions.change.post({
330
+ const a = d ? await $.subscriptions.change.post({
332
331
  subscriptionId: d.id,
333
332
  newPriceId: s.selectedPrice.id,
334
333
  proration: !0
335
- }) : await I.subscriptions.create.post({
334
+ }) : await $.subscriptions.create.post({
336
335
  priceId: s.selectedPrice.id
337
336
  });
338
337
  if (a.error) {
339
338
  g.error(a.error.message || "订阅操作失败");
340
339
  return;
341
340
  }
342
- const b = ie(a.data);
343
- if (b) {
344
- re(b);
341
+ const p = re(a.data);
342
+ if (p) {
343
+ ne(p);
345
344
  return;
346
345
  }
347
- ue(a.data) ? g.success(M(a.data) || "试用已开始") : g.success(M(a.data) || "订阅已更新"), await e.refreshCurrentSubscription();
346
+ ie(a.data) ? g.success(D(a.data) || "试用已开始") : g.success(D(a.data) || "订阅已更新"), await e.refreshCurrentSubscription();
348
347
  } catch (a) {
349
348
  console.error("订阅操作失败", a), g.error("订阅操作失败,请稍后重试");
350
349
  } finally {
@@ -361,6 +360,6 @@ function me(e) {
361
360
  };
362
361
  }
363
362
  export {
364
- me as a,
365
- de as u
363
+ de as a,
364
+ fe as u
366
365
  };
@@ -1,5 +1,5 @@
1
1
  /* empty css */
2
- import "./apiClients-CkI47p36.js";
2
+ import "./apiClients-DT7o0IpO.js";
3
3
  import { Message as O } from "@arco-design/web-vue";
4
4
  import { ref as t } from "vue";
5
5
  function A(r) {
@@ -1,5 +1,5 @@
1
1
  import { c as Ft, g as Ut } from "./_commonjsHelpers-DaMA6jEr.js";
2
- import { o as mt } from "./apiClients-CkI47p36.js";
2
+ import { o as mt } from "./apiClients-DT7o0IpO.js";
3
3
  var Pt = { exports: {} };
4
4
  (function(je, ot) {
5
5
  (function(se, E) {
package/dist/user.js CHANGED
@@ -1,4 +1,4 @@
1
- import { U as a, a as n, b as r, c as t, d as U, _ as u, e as i, f as M, g as o, h as m, i as I, j as c, k as d, l as b, m as f } from "./UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-f2mzNg6i.js";
1
+ import { U as a, a as n, b as r, c as t, d as U, _ as u, e as i, f as M, g as o, h as m, i as I, j as c, k as d, l as b, m as f } from "./UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-C7mV8kGe.js";
2
2
  export {
3
3
  a as UserAccountMenu,
4
4
  n as UserAvatar,
@@ -1,3 +1,4 @@
1
+ import { Client } from '@vafast/api-client';
1
2
  /**
2
3
  * App ID 中间件:添加 app-id header
3
4
  */
@@ -20,3 +21,5 @@ export declare const tokenRefreshMiddleware: import('@vafast/api-client').NamedM
20
21
  * - 其他错误:弹 Message 提示。
21
22
  */
22
23
  export declare const errorMessageMiddleware: import('@vafast/api-client').NamedMiddleware;
24
+ /** 为 API Client 挂载 token 刷新与 401 登录框兜底 */
25
+ export declare function withAuthHandling(client: Client): Client;
@@ -6,6 +6,11 @@ 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
+ type AuthSessionResetListener = () => void;
10
+ /** 注册认证会话重置监听(内存态、profile 等由订阅方自行清理) */
11
+ export declare function onAuthSessionReset(listener: AuthSessionResetListener): () => void;
12
+ /** 清除本地 token 并通知所有订阅方同步内存态 */
13
+ export declare function resetAuthSession(): void;
9
14
  export declare function clearAuth(): void;
10
15
  export declare function setAuth(tokens: {
11
16
  jwtToken: string;
@@ -13,3 +18,4 @@ export declare function setAuth(tokens: {
13
18
  }): void;
14
19
  export declare function getRefreshToken(): string | null;
15
20
  export declare function updateJwtToken(jwtToken: string): void;
21
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huyooo/ui",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [
@@ -108,7 +108,7 @@
108
108
  "@types/json-bigint": "^1.0.4",
109
109
  "@types/node": "^22.5.1",
110
110
  "@unhead/vue": "^2.0.19",
111
- "@vafast/cli": "^0.2.1",
111
+ "@vafast/cli": "^0.2.3",
112
112
  "@vitejs/plugin-vue": "^5.1.2",
113
113
  "bumpp": "^10.2.0",
114
114
  "eslint": "^9.32.0",