feat: 修改获取路由列表
This commit is contained in:
@ -93,16 +93,12 @@ export const useUserStore = defineStore('user', {
|
||||
menuList.forEach((item) => {
|
||||
if (item.children && item.children.length > 0) {
|
||||
item.children.forEach((child: any) => {
|
||||
const matchedRoute = appRoutes.find((route: any) => route.name === child.pathName);
|
||||
if (matchedRoute) {
|
||||
this.allowAccessRoutes.push(matchedRoute);
|
||||
}
|
||||
const matchedRoute = appRoutes.filter((route: any) => child.pathNames.includes(route.name));
|
||||
this.allowAccessRoutes.push(...matchedRoute);
|
||||
});
|
||||
} else {
|
||||
const matchedRoute = appRoutes.find((route: any) => route.name === item.pathName);
|
||||
if (matchedRoute) {
|
||||
this.allowAccessRoutes.push(matchedRoute);
|
||||
}
|
||||
const matchedRoute = appRoutes.filter((route: any) => item.pathNames.includes(route.name));
|
||||
this.allowAccessRoutes.push(...matchedRoute);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user