From 84f26fc593cd22c2d6871d1dca8fdd7b3da9d63c Mon Sep 17 00:00:00 2001 From: baiqi Date: Mon, 25 Nov 2024 16:29:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=8F=9C=E5=8D=95):=20=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=88=B7=E6=96=B0=E8=8F=9C=E5=8D=95=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=B6=88=E5=A4=B1=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/business/ms-menu/use-menu-tree.ts | 6 ++---- frontend/src/store/modules/user/index.ts | 5 ----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/business/ms-menu/use-menu-tree.ts b/frontend/src/components/business/ms-menu/use-menu-tree.ts index 5a64ca112b..186a67fec9 100644 --- a/frontend/src/components/business/ms-menu/use-menu-tree.ts +++ b/frontend/src/components/business/ms-menu/use-menu-tree.ts @@ -28,10 +28,8 @@ export default function useMenuTree() { } // 如果是隐藏的模块,则不显示菜单 - if ( - featureRouteMap[element.name as string] && - !appStore.currentMenuConfig.includes(featureRouteMap[element.name as string]) - ) { + const moduleId = Object.keys(featureRouteMap).find((key) => (element.name as string)?.includes(key)); + if (moduleId && featureRouteMap[moduleId] && !appStore.currentMenuConfig.includes(featureRouteMap[moduleId])) { return null; } diff --git a/frontend/src/store/modules/user/index.ts b/frontend/src/store/modules/user/index.ts index db78a1915d..8ac9b4f3b7 100644 --- a/frontend/src/store/modules/user/index.ts +++ b/frontend/src/store/modules/user/index.ts @@ -257,11 +257,6 @@ const useUserStore = defineStore('user', { }); return; } - if (routeName?.includes('setting')) { - // 访问系统设置下的页面,不需要获取项目信息,会在切换到非系统设置页面时获取(ms-menu组件内初始化会获取) - appStore.setCurrentMenuConfig([]); - return; - } const res = await getProjectInfo(appStore.currentProjectId); if (!res) { // 如果项目被删除或者被禁用,跳转到无项目页面