jiaxing.zhou

feat(权限管理): 屏蔽包含 summary 的路由

- 在 filterAsyncRouter 函数中添加了对包含 summary 的路由的过滤
- 优化了代码格式,增加了空行
......@@ -64,6 +64,10 @@ const permission = {
// 遍历后台传来的路由字符串,转换为组件对象
function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
return asyncRouterMap.filter(route => {
// 屏蔽包含 summary 的路由
if (route.path.includes('summary')) {
return false;
}
if (type && route.children) {
route.children = filterChildren(route.children)
}
......@@ -199,7 +203,7 @@ function routeItemInfo(data) {
meta: { title: item.name, icon: item.icon || '' }
}
]
};
routes.push(route);
......