@huyooo/ui 0.5.37 → 0.5.39
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/WidthContainer-DY1G3Blk.js +629 -0
- package/dist/common.js +1 -1
- package/dist/components/HeaderMenus.vue.d.ts +2 -0
- package/dist/composables/Authkit/useAuthMenu.d.ts +1 -0
- package/dist/composables.js +1 -1
- package/dist/index.js +3 -3
- package/dist/style.css +1 -1
- package/dist/{useSEO-CDBhukDZ.js → useSEO-BPLbTGu_.js} +84 -83
- package/package.json +1 -1
- package/dist/WidthContainer-CGy4PLm9.js +0 -516
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as I, computed as
|
|
1
|
+
import { ref as I, computed as h, watch as C, toValue as G, isRef as W, hasInjectionContext as B, inject as F, watchEffect as J, getCurrentInstance as Q, onBeforeUnmount as Z, onDeactivated as X, onActivated as Y } from "vue";
|
|
2
2
|
import { useRouter as _, useRoute as x } from "vue-router";
|
|
3
3
|
import { u as R } from "./useAuthkitAppsAuthPageInfo-Ct-ElH04.js";
|
|
4
4
|
import { a as U } from "./useAuthkitUsersProfile-B1y2nleU.js";
|
|
@@ -30,13 +30,13 @@ function Se(e, t = "default") {
|
|
|
30
30
|
} else
|
|
31
31
|
e();
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function D(e, t) {
|
|
34
34
|
return Array.isArray(e == null ? void 0 : e.menuTypes) ? e.menuTypes.includes(t) : !1;
|
|
35
35
|
}
|
|
36
36
|
function Ae(e, t, n) {
|
|
37
37
|
for (let r = e.length - 1; r >= 0; r--) {
|
|
38
38
|
const o = e[r];
|
|
39
|
-
if (
|
|
39
|
+
if (D(o.meta, t))
|
|
40
40
|
return o.path;
|
|
41
41
|
}
|
|
42
42
|
return n;
|
|
@@ -47,62 +47,63 @@ function $e(e) {
|
|
|
47
47
|
} = R(), {
|
|
48
48
|
isLoggedIn: r,
|
|
49
49
|
userProfile: o
|
|
50
|
-
} = U(), s =
|
|
51
|
-
var
|
|
52
|
-
return !r.value || !o.value ? [] : ((
|
|
50
|
+
} = U(), s = h(() => {
|
|
51
|
+
var f;
|
|
52
|
+
return !r.value || !o.value ? [] : ((f = o.value.permissions) == null ? void 0 : f.map((a) => a.permissionKey)) || [];
|
|
53
53
|
});
|
|
54
|
-
function i(
|
|
55
|
-
return (n.value.publicRoutes || []).some((
|
|
54
|
+
function i(f) {
|
|
55
|
+
return (n.value.publicRoutes || []).some((d) => d.permissionKey === f);
|
|
56
56
|
}
|
|
57
|
-
function c(
|
|
58
|
-
return r.value ? s.value.includes(
|
|
57
|
+
function c(f) {
|
|
58
|
+
return r.value ? s.value.includes(f) : !1;
|
|
59
59
|
}
|
|
60
|
-
function l(
|
|
60
|
+
function l(f) {
|
|
61
61
|
var a;
|
|
62
62
|
return {
|
|
63
|
-
path:
|
|
64
|
-
name:
|
|
65
|
-
meta:
|
|
66
|
-
children: (a =
|
|
63
|
+
path: f.path,
|
|
64
|
+
name: f.name,
|
|
65
|
+
meta: f.meta,
|
|
66
|
+
children: (a = f.children) == null ? void 0 : a.map((d) => l(d))
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
const
|
|
71
|
-
for (const
|
|
72
|
-
if (
|
|
69
|
+
function p(f, a) {
|
|
70
|
+
const d = [];
|
|
71
|
+
for (const m of f) {
|
|
72
|
+
if (m.path === "/" || m.path === "/:catchAll(.*)")
|
|
73
73
|
continue;
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
const w =
|
|
74
|
+
const u = m.meta;
|
|
75
|
+
if (D(u, a)) {
|
|
76
|
+
const w = m.path;
|
|
77
77
|
if (i(w) || c(w)) {
|
|
78
78
|
const g = {
|
|
79
|
-
name: (
|
|
80
|
-
path:
|
|
81
|
-
icon: (
|
|
82
|
-
|
|
79
|
+
name: (u == null ? void 0 : u.menuName) || (u == null ? void 0 : u.title) || (typeof m.name == "string" ? m.name : m.path),
|
|
80
|
+
path: m.path,
|
|
81
|
+
icon: (u == null ? void 0 : u.menuIcon) || (u == null ? void 0 : u.icon),
|
|
82
|
+
description: (u == null ? void 0 : u.menuDescription) || (u == null ? void 0 : u.description),
|
|
83
|
+
hidden: u == null ? void 0 : u.hidden
|
|
83
84
|
};
|
|
84
|
-
if (
|
|
85
|
-
const P =
|
|
85
|
+
if (m.children && m.children.length > 0) {
|
|
86
|
+
const P = p(m.children, a);
|
|
86
87
|
P.length > 0 && (g.children = P);
|
|
87
88
|
}
|
|
88
|
-
|
|
89
|
+
d.push(g);
|
|
89
90
|
}
|
|
90
|
-
} else if (
|
|
91
|
-
const w =
|
|
92
|
-
|
|
91
|
+
} else if (m.children && m.children.length > 0) {
|
|
92
|
+
const w = p(m.children, a);
|
|
93
|
+
d.push(...w);
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
|
-
return
|
|
96
|
+
return d;
|
|
96
97
|
}
|
|
97
98
|
return {
|
|
98
|
-
menus:
|
|
99
|
+
menus: h(() => {
|
|
99
100
|
if (!e)
|
|
100
101
|
return [];
|
|
101
|
-
const
|
|
102
|
-
return console.log(
|
|
102
|
+
const f = t.getRoutes(), a = f.find((g) => g.path === "/"), d = a != null && a.children ? a.children.map((g) => l(g)) : [], m = new Set(d.map((g) => g.path)), w = f.filter((g) => g.path === "/" || g.path === "/:catchAll(.*)" || m.has(g.path) ? !1 : g.path.split("/").filter((N) => N).length === 1).map(l), T = [...d, ...w];
|
|
103
|
+
return console.log(p(T, e), "过滤菜单"), p(T, e);
|
|
103
104
|
}),
|
|
104
105
|
isRoutePublic: i,
|
|
105
|
-
hasPermission: (
|
|
106
|
+
hasPermission: (f) => i(f) ? !0 : c(f),
|
|
106
107
|
isLoggedIn: r
|
|
107
108
|
};
|
|
108
109
|
}
|
|
@@ -116,20 +117,20 @@ function Te() {
|
|
|
116
117
|
isLoggedIn: i,
|
|
117
118
|
usersProfileSuccess: c
|
|
118
119
|
} = U(), l = I(!1);
|
|
119
|
-
function
|
|
120
|
-
return (r.value.publicRoutes || []).some((
|
|
120
|
+
function p(a) {
|
|
121
|
+
return (r.value.publicRoutes || []).some((m) => m.permissionKey === a);
|
|
121
122
|
}
|
|
122
123
|
function b(a) {
|
|
123
|
-
var
|
|
124
|
-
return !i.value || !s.value ? !1 : (((
|
|
124
|
+
var m;
|
|
125
|
+
return !i.value || !s.value ? !1 : (((m = s.value.permissions) == null ? void 0 : m.map((u) => u.permissionKey)) || []).includes(a);
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
-
var
|
|
127
|
+
function f(a) {
|
|
128
|
+
var d, m;
|
|
128
129
|
if (!o.value) {
|
|
129
130
|
console.log("权限检查跳过:appsAuthPageInfoSuccess 未加载完成", a);
|
|
130
131
|
return;
|
|
131
132
|
}
|
|
132
|
-
if (l.value = !0,
|
|
133
|
+
if (l.value = !0, p(a)) {
|
|
133
134
|
console.log("权限检查通过:公开路由", a), l.value = !1;
|
|
134
135
|
return;
|
|
135
136
|
}
|
|
@@ -142,16 +143,16 @@ function Te() {
|
|
|
142
143
|
return;
|
|
143
144
|
}
|
|
144
145
|
b(a) ? console.log("权限检查通过:有权限", a) : (console.log("权限检查失败:无权限,重定向到首页", a, {
|
|
145
|
-
permissions: (
|
|
146
|
+
permissions: (m = (d = s.value) == null ? void 0 : d.permissions) == null ? void 0 : m.map((u) => u.permissionKey)
|
|
146
147
|
}), e.replace("/")), l.value = !1;
|
|
147
148
|
}
|
|
148
149
|
return n(), C(() => t.path, (a) => {
|
|
149
|
-
|
|
150
|
+
f(a);
|
|
150
151
|
}), C([o, c], ([a]) => {
|
|
151
|
-
a &&
|
|
152
|
+
a && f(t.path);
|
|
152
153
|
}), {
|
|
153
154
|
isChecking: l,
|
|
154
|
-
isRoutePublic:
|
|
155
|
+
isRoutePublic: p,
|
|
155
156
|
hasPermission: b
|
|
156
157
|
};
|
|
157
158
|
}
|
|
@@ -205,7 +206,7 @@ const ee = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), te
|
|
|
205
206
|
msapplicationConfig: "msapplication-Config",
|
|
206
207
|
msapplicationTileColor: "msapplication-TileColor",
|
|
207
208
|
msapplicationTileImage: "msapplication-TileImage"
|
|
208
|
-
},
|
|
209
|
+
}, K = {
|
|
209
210
|
appleItunesApp: {
|
|
210
211
|
unpack: {
|
|
211
212
|
entrySeparator: ", ",
|
|
@@ -242,7 +243,7 @@ function y(e) {
|
|
|
242
243
|
const t = e.replace(/([A-Z])/g, "-$1").toLowerCase(), n = t.indexOf("-");
|
|
243
244
|
return n === -1 ? t : S.META.has(t.slice(0, n)) || S.OG.has(t.slice(0, n)) ? e.replace(/([A-Z])/g, ":$1").toLowerCase() : t;
|
|
244
245
|
}
|
|
245
|
-
function
|
|
246
|
+
function L(e) {
|
|
246
247
|
return Object.fromEntries(Object.entries(e).filter(([t, n]) => String(n) !== "false" && t));
|
|
247
248
|
}
|
|
248
249
|
function j(e) {
|
|
@@ -252,29 +253,29 @@ function H(e, t = {}) {
|
|
|
252
253
|
const { entrySeparator: n = "", keyValueSeparator: r = "", wrapValue: o, resolve: s } = t;
|
|
253
254
|
return Object.entries(e).map(([i, c]) => {
|
|
254
255
|
if (s) {
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
257
|
-
return
|
|
256
|
+
const p = s({ key: i, value: c });
|
|
257
|
+
if (p !== void 0)
|
|
258
|
+
return p;
|
|
258
259
|
}
|
|
259
260
|
const l = typeof c == "object" ? H(c, t) : typeof c == "number" ? c.toString() : typeof c == "string" && o ? `${o}${c.replace(new RegExp(o, "g"), `\\${o}`)}${o}` : c;
|
|
260
261
|
return `${i}${r}${l}`;
|
|
261
262
|
}).join(n);
|
|
262
263
|
}
|
|
263
264
|
function V(e, t) {
|
|
264
|
-
const n =
|
|
265
|
+
const n = L(t), r = y(e), o = k(r);
|
|
265
266
|
if (!E.has(r))
|
|
266
267
|
return [{ [o]: r, ...n }];
|
|
267
268
|
const s = Object.fromEntries(
|
|
268
269
|
Object.entries(n).map(([i, c]) => [`${e}${i === "url" ? "" : `${i[0].toUpperCase()}${i.slice(1)}`}`, c])
|
|
269
270
|
);
|
|
270
271
|
return A(s || {}).sort((i, c) => {
|
|
271
|
-
var l,
|
|
272
|
-
return (((l = i[o]) == null ? void 0 : l.length) || 0) - (((
|
|
272
|
+
var l, p;
|
|
273
|
+
return (((l = i[o]) == null ? void 0 : l.length) || 0) - (((p = c[o]) == null ? void 0 : p.length) || 0);
|
|
273
274
|
});
|
|
274
275
|
}
|
|
275
276
|
function k(e) {
|
|
276
277
|
var r;
|
|
277
|
-
if (((r =
|
|
278
|
+
if (((r = K[e]) == null ? void 0 : r.metaKey) === "http-equiv" || S.HTTP_EQUIV.has(e))
|
|
278
279
|
return "http-equiv";
|
|
279
280
|
const t = y(e), n = t.indexOf(":");
|
|
280
281
|
return n === -1 ? "name" : S.OG.has(t.slice(0, n)) ? "property" : "name";
|
|
@@ -289,7 +290,7 @@ function ie(e, t) {
|
|
|
289
290
|
entrySeparator: ", ",
|
|
290
291
|
resolve: ({ value: r, key: o }) => r === null ? "" : typeof r == "boolean" ? o : void 0,
|
|
291
292
|
// @ts-expect-error untyped
|
|
292
|
-
...(n =
|
|
293
|
+
...(n = K[t]) == null ? void 0 : n.unpack
|
|
293
294
|
});
|
|
294
295
|
}
|
|
295
296
|
function A(e) {
|
|
@@ -305,9 +306,9 @@ function A(e) {
|
|
|
305
306
|
for (const i of s)
|
|
306
307
|
if (typeof i == "object" && i !== null) {
|
|
307
308
|
const c = [], l = [];
|
|
308
|
-
for (const [
|
|
309
|
-
const
|
|
310
|
-
(
|
|
309
|
+
for (const [p, b] of Object.entries(i)) {
|
|
310
|
+
const f = `${o}${p === "url" ? "" : `:${p}`}`, a = A({ [f]: b });
|
|
311
|
+
(p === "url" ? c : l).push(...a);
|
|
311
312
|
}
|
|
312
313
|
t.push(...c, ...l);
|
|
313
314
|
} else
|
|
@@ -324,13 +325,13 @@ function A(e) {
|
|
|
324
325
|
[l]: `${i}:${c}:secure_url`,
|
|
325
326
|
content: s.secureUrl
|
|
326
327
|
});
|
|
327
|
-
for (const [
|
|
328
|
-
|
|
329
|
-
[l]: `${i}:${c}:${
|
|
328
|
+
for (const [p, b] of Object.entries(s))
|
|
329
|
+
p !== "url" && p !== "secureUrl" && t.push({
|
|
330
|
+
[l]: `${i}:${c}:${p}`,
|
|
330
331
|
// @ts-expect-error untyped
|
|
331
332
|
content: b
|
|
332
333
|
});
|
|
333
|
-
} else E.has(y(o)) ? t.push(...V(o, s)) : n[o] =
|
|
334
|
+
} else E.has(y(o)) ? t.push(...V(o, s)) : n[o] = L(s);
|
|
334
335
|
else
|
|
335
336
|
n[o] = s;
|
|
336
337
|
}
|
|
@@ -492,9 +493,9 @@ function z() {
|
|
|
492
493
|
}
|
|
493
494
|
function O(e, t = {}) {
|
|
494
495
|
const n = t.head || /* @__PURE__ */ z();
|
|
495
|
-
return n.ssr ? n.push(e || {}, t) :
|
|
496
|
+
return n.ssr ? n.push(e || {}, t) : de(n, e, t);
|
|
496
497
|
}
|
|
497
|
-
function
|
|
498
|
+
function de(e, t, n = {}) {
|
|
498
499
|
const r = I(!1);
|
|
499
500
|
let o;
|
|
500
501
|
return J(() => {
|
|
@@ -532,7 +533,7 @@ function Ve() {
|
|
|
532
533
|
image: i,
|
|
533
534
|
url: c,
|
|
534
535
|
type: l = "website"
|
|
535
|
-
} = n,
|
|
536
|
+
} = n, p = o && o.length > 155 ? `${o.substring(0, 152)}...` : o;
|
|
536
537
|
O({
|
|
537
538
|
title: r,
|
|
538
539
|
link: c ? [{
|
|
@@ -540,17 +541,17 @@ function Ve() {
|
|
|
540
541
|
href: c
|
|
541
542
|
}] : []
|
|
542
543
|
}), M({
|
|
543
|
-
description:
|
|
544
|
+
description: p || o,
|
|
544
545
|
keywords: s,
|
|
545
546
|
ogTitle: r,
|
|
546
|
-
ogDescription:
|
|
547
|
+
ogDescription: p || o,
|
|
547
548
|
ogType: l === "product" ? void 0 : l,
|
|
548
549
|
// product 类型不被支持,跳过
|
|
549
550
|
ogUrl: c,
|
|
550
551
|
ogImage: i,
|
|
551
552
|
twitterCard: "summary_large_image",
|
|
552
553
|
twitterTitle: r,
|
|
553
|
-
twitterDescription:
|
|
554
|
+
twitterDescription: p || o,
|
|
554
555
|
twitterImage: i
|
|
555
556
|
});
|
|
556
557
|
}
|
|
@@ -562,8 +563,8 @@ function Ve() {
|
|
|
562
563
|
function _e() {
|
|
563
564
|
const e = x(), t = () => e.meta;
|
|
564
565
|
O({
|
|
565
|
-
title:
|
|
566
|
-
link:
|
|
566
|
+
title: h(() => t().title || ""),
|
|
567
|
+
link: h(() => {
|
|
567
568
|
const n = t();
|
|
568
569
|
return n.url ? [{
|
|
569
570
|
rel: "canonical",
|
|
@@ -571,32 +572,32 @@ function _e() {
|
|
|
571
572
|
}] : [];
|
|
572
573
|
})
|
|
573
574
|
}), M({
|
|
574
|
-
description:
|
|
575
|
+
description: h(() => {
|
|
575
576
|
const r = t().description;
|
|
576
577
|
if (r)
|
|
577
578
|
return r.length > 155 ? `${r.substring(0, 152)}...` : r;
|
|
578
579
|
}),
|
|
579
|
-
keywords:
|
|
580
|
-
ogTitle:
|
|
581
|
-
ogDescription:
|
|
580
|
+
keywords: h(() => t().keywords),
|
|
581
|
+
ogTitle: h(() => t().title),
|
|
582
|
+
ogDescription: h(() => {
|
|
582
583
|
const r = t().description;
|
|
583
584
|
if (r)
|
|
584
585
|
return r.length > 155 ? `${r.substring(0, 152)}...` : r;
|
|
585
586
|
}),
|
|
586
|
-
ogType:
|
|
587
|
+
ogType: h(() => {
|
|
587
588
|
const r = t().type || "website";
|
|
588
589
|
return r === "product" ? void 0 : r;
|
|
589
590
|
}),
|
|
590
|
-
ogUrl:
|
|
591
|
-
ogImage:
|
|
591
|
+
ogUrl: h(() => t().url),
|
|
592
|
+
ogImage: h(() => t().image),
|
|
592
593
|
twitterCard: "summary_large_image",
|
|
593
|
-
twitterTitle:
|
|
594
|
-
twitterDescription:
|
|
594
|
+
twitterTitle: h(() => t().title),
|
|
595
|
+
twitterDescription: h(() => {
|
|
595
596
|
const r = t().description;
|
|
596
597
|
if (r)
|
|
597
598
|
return r.length > 155 ? `${r.substring(0, 152)}...` : r;
|
|
598
599
|
}),
|
|
599
|
-
twitterImage:
|
|
600
|
+
twitterImage: h(() => t().image)
|
|
600
601
|
});
|
|
601
602
|
}
|
|
602
603
|
export {
|