fix(菜单): 系统页面刷新菜单模块消失修复

This commit is contained in:
baiqi 2024-11-25 16:29:48 +08:00 committed by 刘瑞斌
parent c8ea1a4bba
commit 84f26fc593
2 changed files with 2 additions and 9 deletions

View File

@ -28,10 +28,8 @@ export default function useMenuTree() {
} }
// 如果是隐藏的模块,则不显示菜单 // 如果是隐藏的模块,则不显示菜单
if ( const moduleId = Object.keys(featureRouteMap).find((key) => (element.name as string)?.includes(key));
featureRouteMap[element.name as string] && if (moduleId && featureRouteMap[moduleId] && !appStore.currentMenuConfig.includes(featureRouteMap[moduleId])) {
!appStore.currentMenuConfig.includes(featureRouteMap[element.name as string])
) {
return null; return null;
} }

View File

@ -257,11 +257,6 @@ const useUserStore = defineStore('user', {
}); });
return; return;
} }
if (routeName?.includes('setting')) {
// 访问系统设置下的页面,不需要获取项目信息,会在切换到非系统设置页面时获取(ms-menu组件内初始化会获取)
appStore.setCurrentMenuConfig([]);
return;
}
const res = await getProjectInfo(appStore.currentProjectId); const res = await getProjectInfo(appStore.currentProjectId);
if (!res) { if (!res) {
// 如果项目被删除或者被禁用,跳转到无项目页面 // 如果项目被删除或者被禁用,跳转到无项目页面