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

页面问题解决

parent 8b2d0f2a
...@@ -25,6 +25,7 @@ const routeFilter = (route: any) => { ...@@ -25,6 +25,7 @@ const routeFilter = (route: any) => {
// 抽出角色 // 抽出角色
const { auth } = meta || {}; const { auth } = meta || {};
if (!auth) return false; if (!auth) return false;
console.log("数据查看",route)
// 进行角色权限判断 // 进行角色权限判断
return roleList.some((role) => auth === role); return roleList.some((role) => auth === role);
}; };
...@@ -32,10 +33,18 @@ const routeFilter = (route: any) => { ...@@ -32,10 +33,18 @@ const routeFilter = (route: any) => {
Object.keys(modules).forEach((key) => { Object.keys(modules).forEach((key) => {
const mod = (modules as Recordable)[key].default || {}; const mod = (modules as Recordable)[key].default || {};
const modList = Array.isArray(mod) ? [...mod] : [mod]; const modList = Array.isArray(mod) ? [...mod] : [mod];
const anyRoute = filter(modList, routeFilter); if(localStorage.getItem('urlRoles')){
const anyRoute = filter(modList, routeFilter);
if (anyRoute.length > 0) { if (anyRoute.length > 0) {
routeModuleList.push(...anyRoute); routeModuleList.push(...anyRoute);
}
}
else {
getList().then((res) => {
roleList = res;
localStorage.setItem('urlRoles', JSON.stringify(res));
window.location.reload();
});
} }
}); });
......
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