fix(router): resolve menu loading failure when permission is in "role mode" (#3660)

closed #3655
This commit is contained in:
Zhong 2024-03-07 13:59:32 +08:00 committed by GitHub
parent a4cc1d5316
commit c7631fed68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 8 deletions

View File

@ -33,9 +33,7 @@ function joinParentPath(menus: Menu[], parentPath = '') {
// Parsing the menu module // Parsing the menu module
export function transformMenuModule(menuModule: MenuModule): Menu { export function transformMenuModule(menuModule: MenuModule): Menu {
const { menu } = menuModule; const menuList = [menuModule];
const menuList = [menu];
joinParentPath(menuList); joinParentPath(menuList);
return menuList[0]; return menuList[0];

View File

@ -10,7 +10,7 @@ import { router } from '@/router';
import { PermissionModeEnum } from '@/enums/appEnum'; import { PermissionModeEnum } from '@/enums/appEnum';
import { pathToRegexp } from 'path-to-regexp'; import { pathToRegexp } from 'path-to-regexp';
const modules = import.meta.glob('./modules/**/*.ts', { eager: true }); const modules = import.meta.glob('../routes/modules/**/*.ts', { eager: true });
const menuModules: MenuModule[] = []; const menuModules: MenuModule[] = [];

View File

@ -51,10 +51,7 @@ export interface Menu {
hideMenu?: boolean; hideMenu?: boolean;
} }
export interface MenuModule { export type MenuModule = Menu;
orderNo?: number;
menu: Menu;
}
// export type AppRouteModule = RouteModule | AppRouteRecordRaw; // export type AppRouteModule = RouteModule | AppRouteRecordRaw;
export type AppRouteModule = AppRouteRecordRaw; export type AppRouteModule = AppRouteRecordRaw;