fix: 优化菜单空白多次调用项目模块配置问题

This commit is contained in:
xinxin.wu 2024-04-09 14:23:12 +08:00 committed by 刘瑞斌
parent 4408222206
commit ef26e5e537
2 changed files with 2 additions and 3 deletions

View File

@ -34,6 +34,8 @@
const { logout } = useUser();
const router = useRouter();
const route = useRoute();
// @desc:
appStore.getProjectInfos();
const { menuTree } = useMenuTree();
const collapsed = computed({
get() {

View File

@ -86,9 +86,6 @@ export async function topLevelMenuHasPermission(route: RouteLocationNormalized |
const userStore = useUserStore();
const appStore = useAppStore();
const { currentMenuConfig } = appStore;
if (!currentMenuConfig.length) {
await appStore.getProjectInfos();
}
if (currentMenuConfig.length && !currentMenuConfig.includes(route.name as string)) {
// 没有配置的菜单不显示