mirror of
https://gitee.com/fantastic-admin/basic.git
synced 2024-12-10 07:58:27 +08:00
优化无权限路由的过滤函数
This commit is contained in:
parent
9e723d44df
commit
49d9e5eb2d
@ -176,14 +176,14 @@ const useRouteStore = defineStore(
|
||||
const res: any = []
|
||||
routes.forEach((route) => {
|
||||
const tmpRoute = cloneDeep(route)
|
||||
if (tmpRoute.children) {
|
||||
tmpRoute.children = filterAsyncRoutesNoAuth(tmpRoute.children, permissions)
|
||||
tmpRoute.children.length && res.push(tmpRoute)
|
||||
if (hasPermission(permissions, route)) {
|
||||
if (tmpRoute.children) {
|
||||
tmpRoute.children = filterAsyncRoutesNoAuth(tmpRoute.children, permissions)
|
||||
tmpRoute.children.length && res.push(tmpRoute)
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!hasPermission(permissions, route)) {
|
||||
res.push(tmpRoute)
|
||||
}
|
||||
res.push(tmpRoute)
|
||||
}
|
||||
})
|
||||
return res
|
||||
|
Loading…
Reference in New Issue
Block a user