befly-admin 3.12.10 → 3.12.12
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "befly-admin",
|
|
3
|
-
"version": "3.12.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "3.12.12",
|
|
4
|
+
"gitHead": "0fe78b035aa2274909d0a303f553b80e0bbf88b2",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Befly Admin - 基于 Vue3 + TDesign Vue Next 的后台管理系统",
|
|
7
7
|
"files": [
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
"preview": "bunx --bun vite preview"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@befly-addon/admin": "^1.8.
|
|
31
|
+
"@befly-addon/admin": "^1.8.8",
|
|
32
32
|
"@iconify-json/lucide": "^1.2.86",
|
|
33
33
|
"axios": "^1.13.2",
|
|
34
34
|
"befly-shared": "^1.4.5",
|
|
35
|
-
"befly-vite": "^1.4.
|
|
35
|
+
"befly-vite": "^1.4.11",
|
|
36
36
|
"pinia": "^3.0.4",
|
|
37
37
|
"tdesign-vue-next": "^1.18.0",
|
|
38
|
-
"vite": "^8.0.0-beta.
|
|
38
|
+
"vite": "^8.0.0-beta.9",
|
|
39
39
|
"vue": "^3.5.27",
|
|
40
|
-
"vue-router": "^5.0.0-beta.
|
|
40
|
+
"vue-router": "^5.0.0-beta.1"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"bun": ">=1.3.0",
|
package/src/layouts/default.vue
CHANGED
|
@@ -81,7 +81,6 @@ import { reactive } from "vue";
|
|
|
81
81
|
|
|
82
82
|
const router = useRouter();
|
|
83
83
|
const route = useRoute();
|
|
84
|
-
const global = useGlobal();
|
|
85
84
|
|
|
86
85
|
const loginPath = "/addon/admin/login";
|
|
87
86
|
|
|
@@ -132,73 +131,13 @@ async function fetchUserMenus() {
|
|
|
132
131
|
const { data } = await $Http.post("/addon/admin/menu/all");
|
|
133
132
|
const lists = Array.isArray(data?.lists) ? data.lists : [];
|
|
134
133
|
|
|
135
|
-
const bizMenus = [];
|
|
136
|
-
const routeRecords = router.getRoutes();
|
|
137
|
-
|
|
138
|
-
for (const record of routeRecords) {
|
|
139
|
-
const path = normalizePath(record.path);
|
|
140
|
-
|
|
141
|
-
if (typeof path !== "string") {
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (path === "/") {
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
if (path === normalizePath(loginPath)) {
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (path.startsWith("/addon/")) {
|
|
154
|
-
continue;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const title = typeof record.meta?.title === "string" ? record.meta.title : "";
|
|
158
|
-
if (title.length === 0) {
|
|
159
|
-
continue;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (bizMenus.some((m) => m.path === path)) {
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
bizMenus.push({
|
|
167
|
-
id: `biz_${path.replace(/[^a-zA-Z0-9]+/g, "_")}`,
|
|
168
|
-
parentPath: "__biz__",
|
|
169
|
-
name: title,
|
|
170
|
-
path: path
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
bizMenus.sort((a, b) => String(a.path).localeCompare(String(b.path)));
|
|
175
|
-
|
|
176
|
-
const bizMenusFlat =
|
|
177
|
-
bizMenus.length > 0
|
|
178
|
-
? [
|
|
179
|
-
{
|
|
180
|
-
id: "biz",
|
|
181
|
-
parentPath: "",
|
|
182
|
-
name: "业务",
|
|
183
|
-
path: "__biz__",
|
|
184
|
-
sort: 2
|
|
185
|
-
}
|
|
186
|
-
].concat(
|
|
187
|
-
bizMenus.map((m) => {
|
|
188
|
-
return Object.assign({}, m, { sort: 2 });
|
|
189
|
-
})
|
|
190
|
-
)
|
|
191
|
-
: [];
|
|
192
|
-
|
|
193
134
|
const normalizedLists = lists.map((menu) => {
|
|
194
135
|
const menuPath = normalizePath(menu?.path);
|
|
195
136
|
const menuParentPath = normalizeParentPath(menu?.parentPath);
|
|
196
137
|
return Object.assign({}, menu, { path: menuPath, parentPath: menuParentPath });
|
|
197
138
|
});
|
|
198
139
|
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
const treeResult = arrayToTree(mergedLists, "path", "parentPath", "children", "sort");
|
|
140
|
+
const treeResult = arrayToTree(normalizedLists, "path", "parentPath", "children", "sort");
|
|
202
141
|
|
|
203
142
|
$Data.userMenusFlat = treeResult.flat;
|
|
204
143
|
$Data.userMenus = treeResult.tree;
|
|
@@ -10,6 +10,7 @@ declare global {
|
|
|
10
10
|
const $Http: typeof import('../plugins/http').$Http
|
|
11
11
|
const $Router: typeof import('../plugins/router').$Router
|
|
12
12
|
const $Storage: typeof import('../plugins/storage').$Storage
|
|
13
|
+
const DialogPlugin: typeof import('tdesign-vue-next').DialogPlugin
|
|
13
14
|
const EffectScope: typeof import('vue').EffectScope
|
|
14
15
|
const MessagePlugin: typeof import('tdesign-vue-next').MessagePlugin
|
|
15
16
|
const acceptHMRUpdate: typeof import('pinia').acceptHMRUpdate
|
|
@@ -111,7 +112,6 @@ declare module 'vue' {
|
|
|
111
112
|
readonly $Router: UnwrapRef<typeof import('../plugins/router')['$Router']>
|
|
112
113
|
readonly $Storage: UnwrapRef<typeof import('../plugins/storage')['$Storage']>
|
|
113
114
|
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
|
114
|
-
readonly MessagePlugin: UnwrapRef<typeof import('tdesign-vue-next')['MessagePlugin']>
|
|
115
115
|
readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
|
|
116
116
|
readonly computed: UnwrapRef<typeof import('vue')['computed']>
|
|
117
117
|
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
|
|
@@ -16,6 +16,5 @@ declare module 'vue' {
|
|
|
16
16
|
PagedTableDetail: typeof import('./../components/pagedTableDetail.vue')['default']
|
|
17
17
|
RouterLink: typeof import('vue-router')['RouterLink']
|
|
18
18
|
RouterView: typeof import('vue-router')['RouterView']
|
|
19
|
-
TConfigProvider: typeof import('tdesign-vue-next')['ConfigProvider']
|
|
20
19
|
}
|
|
21
20
|
}
|