mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-06 04:00:06 +08:00
fix: problem tha the authority config of route be overwritten; 🐛
修复:路由权限配置被覆盖的问题;
This commit is contained in:
parent
1fb75f491d
commit
5ec6f73d6f
@ -55,10 +55,12 @@ function hasAnyRole(required, roles) {
|
|||||||
*/
|
*/
|
||||||
function filterMenu(menuData, permissions, roles) {
|
function filterMenu(menuData, permissions, roles) {
|
||||||
menuData.forEach(menu => {
|
menuData.forEach(menu => {
|
||||||
|
if (menu.meta && menu.meta.invisible === undefined) {
|
||||||
menu.meta.invisible = !hasPermission(menu, permissions) && !hasRole(menu, roles)
|
menu.meta.invisible = !hasPermission(menu, permissions) && !hasRole(menu, roles)
|
||||||
if (menu.children && menu.children.length > 0) {
|
if (menu.children && menu.children.length > 0) {
|
||||||
filterMenu(menu.children, permissions, roles)
|
filterMenu(menu.children, permissions, roles)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user