fix(ui):common double menu (#324)

This commit is contained in:
wang-liang0615 2023-12-21 14:59:39 +08:00 committed by GitHub
parent 75122f7a40
commit 3e2943b49e
1 changed files with 9 additions and 8 deletions

View File

@ -38,15 +38,16 @@ async function filterAsyncRouter(routerMap, roles) {
const default_route = ['company_info', 'company_structure', 'company_group'] const default_route = ['company_info', 'company_structure', 'company_group']
if (default_route.includes(route.name)) { if (default_route.includes(route.name)) {
filteredRoutes.push(route) filteredRoutes.push(route)
} } else {
await hasPermission(roles.permissions, route).then(async flag => { await hasPermission(roles.permissions, route).then(async flag => {
if (flag) { if (flag) {
if (route.children && route.children.length) { if (route.children && route.children.length) {
route.children = await filterAsyncRouter(route.children, roles) route.children = await filterAsyncRouter(route.children, roles)
}
filteredRoutes.push(route)
} }
filteredRoutes.push(route) })
} }
})
} }
return filteredRoutes return filteredRoutes
} }