diff --git a/src/layout/components/SideBar/SideBarMenu.vue b/src/layout/components/SideBar/SideBarMenu.vue index c3cb4d9..23a41f9 100644 --- a/src/layout/components/SideBar/SideBarMenu.vue +++ b/src/layout/components/SideBar/SideBarMenu.vue @@ -52,31 +52,19 @@ const routes = computed(() => { const fRoutes = filterRoutes(router.getRoutes()); const data = fRoutes.filter((item) => !EXCLUDE_NAMES.includes(item.name)); const menusPermission = getItem("menusPermission"); - console.log(JSON.parse(localStorage.getItem("menusPermission"))); - console.log( - router.getRoutes().map((r) => ({ name: r.name, path: r.path })), - "xxx" - ); - // menusPermission 里存的 name - router - .getRoutes() - .filter((r) => r.path === "/") - .map((r) => ({ - name: r.name, - path: r.path, - children: r.children?.map((c) => ({ name: c.name, path: c.path })) - })); - console.log(JSON.parse(localStorage.getItem("menusPermission"))); + // 如果 menusPermission 为 null 或 undefined,不显示菜单 + if (menusPermission === null || menusPermission === undefined) { + return []; + } const menusSet = new Set( Array.isArray(menusPermission) ? menusPermission.map((item) => `${item}`) : [] ); - console.log(menusSet); const permissionFiltered = menusSet.size ? filterRoutesByMenusPermission(data, menusSet) - : data; + : []; return generateMenus(permissionFiltered); }); if (!store.getters.token) { diff --git a/src/router/index.js b/src/router/index.js index af30339..001d96f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -329,7 +329,7 @@ export const publicRoutes = [ icon: "article-create" } }, - + { path: "/marksControl", name: "marksControl", @@ -349,8 +349,8 @@ export const publicRoutes = [ icon: "article-create" } }, - - + + // { // path: "/DeploymentAudit", // name: "DeploymentAudit", @@ -434,15 +434,7 @@ export const publicRoutes = [ icon: "article-create" } }, - // { - // path: "/InformationReporting", - // name: "InformationReporting", - // component: () => import("@/views/backOfficeSystem/InformationReporting/index.vue"), - // meta: { - // title: "蜂群信息", - // icon: "article-create" - // } - // }, + // { // path: "/MakeAcomment", // name: "MakeAcomment", @@ -492,6 +484,14 @@ export const publicRoutes = [ title: "线索发布", icon: "article" } + }, { + path: "/InformationReporting", + name: "InformationReporting", + component: () => import("@/views/backOfficeSystem/InformationReporting/index.vue"), + meta: { + title: "蜂群信息", + icon: "article-create" + } }, // { // path: "/InformationFlows", diff --git a/src/views/backOfficeSystem/systemConfig/role-list/conponents/PrivilegesDialog.vue b/src/views/backOfficeSystem/systemConfig/role-list/conponents/PrivilegesDialog.vue index a6d4257..df441bb 100644 --- a/src/views/backOfficeSystem/systemConfig/role-list/conponents/PrivilegesDialog.vue +++ b/src/views/backOfficeSystem/systemConfig/role-list/conponents/PrivilegesDialog.vue @@ -15,8 +15,7 @@ node-key="id" show-checkbox default-expand-all - :check-strictly="false" - @check="handleCheck" + :check-strictly="checkStrictly" />