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) { // 如果项目被删除或者被禁用,跳转到无项目页面