mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-09-10 12:50:38 +08:00
optimization logic
This commit is contained in:
parent
d6ac227995
commit
225a61770c
@ -23,11 +23,12 @@ function filterAsyncRouter(routes, roles) {
|
||||
|
||||
routes.forEach(route => {
|
||||
const tmp = { ...route }
|
||||
if (hasPermission(roles, tmp)) {
|
||||
if (tmp.children) {
|
||||
tmp.children = filterAsyncRouter(tmp.children, roles)
|
||||
}
|
||||
|
||||
hasPermission(roles, tmp) && res.push(tmp)
|
||||
res.push(tmp)
|
||||
}
|
||||
})
|
||||
|
||||
return res
|
||||
|
Loading…
x
Reference in New Issue
Block a user