fix: update

This commit is contained in:
Fine 2023-07-10 11:55:32 +08:00
parent ccc8924d26
commit 6dc0a4a2a8
3 changed files with 11 additions and 8 deletions

View File

@ -30,7 +30,7 @@ const router = createRouter({
(window as any).axiosCancel = [];
const defaultPath = routesLayers[0].children[0].path;
const defaultPath = (routesLayers[0] && routesLayers[0].children[0].path) || "";
router.beforeEach((to, from, next) => {
// const token = window.localStorage.getItem("skywalking-authority");

View File

@ -25,8 +25,9 @@ async function layerDashboards() {
path: "",
component: Layout,
meta: {
icon: item.icon,
icon: item.icon || "cloud_queue",
title: item.title,
hasGroup: item.hasGroup,
},
children: item.subItems && item.subItems.length ? [] : undefined,
};
@ -37,6 +38,7 @@ async function layerDashboards() {
meta: {
title: child.title,
layer: child.layer,
icon: child.icon || "cloud_queue",
},
};
d.component = () => import("@/views/Layer.vue");

View File

@ -172,17 +172,18 @@ export const appStore = defineStore({
);
},
async getActivateMenus() {
// localStorage.removeItem("customMenus");
const resp = (await this.queryMenuItems()) || {};
const menus = (resp.getMenuItems || []).map((d: MenuOptions, index: number) => {
const name = `${d.title.replace(/\s+/g, "-")}-${index}`;
d.name = name;
d.path = `/${name}`;
const t = `${d.title.replace(/\s+/g, "-")}`;
d.name = `${t}-${index}`;
d.path = `/${t}`;
if (d.subItems && d.subItems.length) {
d.hasGroup = true;
d.subItems = d.subItems.map((item: any, sub: number) => {
const id = `${d.title.replace(/\s+/g, "-")}-${index}${sub}`;
item.name = id;
item.path = `/${id}`;
const id = `${item.title.replace(/\s+/g, "-")}`;
item.name = `${id}-${index}${sub}`;
item.path = `/${t}/${id}`;
return item;
});
} else {