提交 5514c2e7 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

fix: 【ID1004561】

【系统管理】新建/编辑用户、角色、组织时,左侧的菜单没高亮显示
上级 874fd25a
...@@ -53,6 +53,7 @@ export const filterAsyncRouter = (routers) => { // 遍历后台传来的路由 ...@@ -53,6 +53,7 @@ export const filterAsyncRouter = (routers) => { // 遍历后台传来的路由
router.component = loadView(component) router.component = loadView(component)
} }
} }
router.name && fillMeta(router)
if (router.children && router.children.length) { if (router.children && router.children.length) {
router.children = filterAsyncRouter(router.children) router.children = filterAsyncRouter(router.children)
} }
...@@ -66,6 +67,14 @@ export const filterAsyncRouter = (routers) => { // 遍历后台传来的路由 ...@@ -66,6 +67,14 @@ export const filterAsyncRouter = (routers) => { // 遍历后台传来的路由
}) })
} }
// 后台设计时未考虑activeMenu字段 这里先前端处理一下
export const fillMeta = (router) => {
router.name.includes('system-user') && (router.meta.activeMenu = '/system/user')
router.name.includes('system-role') && (router.meta.activeMenu = '/system/role')
router.name.includes('system-dept') && (router.meta.activeMenu = '/system/dept')
// return router
}
// 包装一层父级目录 // 包装一层父级目录
export const decorate = (router) => { export const decorate = (router) => {
const parent = { const parent = {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论