Commit 0766dde2 authored by 牛虎林's avatar 牛虎林

页面问题解决

parent 8b2d0f2a
......@@ -25,6 +25,7 @@ const routeFilter = (route: any) => {
// 抽出角色
const { auth } = meta || {};
if (!auth) return false;
console.log("数据查看",route)
// 进行角色权限判断
return roleList.some((role) => auth === role);
};
......@@ -32,11 +33,19 @@ const routeFilter = (route: any) => {
Object.keys(modules).forEach((key) => {
const mod = (modules as Recordable)[key].default || {};
const modList = Array.isArray(mod) ? [...mod] : [mod];
if(localStorage.getItem('urlRoles')){
const anyRoute = filter(modList, routeFilter);
if (anyRoute.length > 0) {
routeModuleList.push(...anyRoute);
}
}
else {
getList().then((res) => {
roleList = res;
localStorage.setItem('urlRoles', JSON.stringify(res));
window.location.reload();
});
}
});
export const asyncRoutes = [PAGE_NOT_FOUND_ROUTE, ...routeModuleList];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment