mirror of
https://gitee.com/fantastic-admin/basic.git
synced 2024-12-05 13:37:45 +08:00
修复路由meta.auth
设置为''
/[]
时,权限判断为无权限的问题
This commit is contained in:
parent
108073b6e1
commit
c253ef6fb4
@ -99,11 +99,15 @@ const useMenuStore = defineStore(
|
||||
let isAuth = false
|
||||
if (menu.meta && menu.meta.auth) {
|
||||
isAuth = permissions.some((auth) => {
|
||||
return typeof menu.meta?.auth === 'string'
|
||||
? menu.meta.auth === auth
|
||||
: typeof menu.meta?.auth === 'object'
|
||||
? menu.meta.auth.includes(auth)
|
||||
: false
|
||||
if (typeof menu.meta?.auth === 'string') {
|
||||
return menu.meta.auth !== '' ? menu.meta.auth === auth : true
|
||||
}
|
||||
else if (typeof menu.meta?.auth === 'object') {
|
||||
return menu.meta.auth.length > 0 ? menu.meta.auth.includes(auth) : true
|
||||
}
|
||||
else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
|
@ -111,11 +111,15 @@ const useRouteStore = defineStore(
|
||||
let isAuth = false
|
||||
if (route.meta?.auth) {
|
||||
isAuth = permissions.some((auth) => {
|
||||
return typeof route.meta?.auth === 'string'
|
||||
? route.meta.auth === auth
|
||||
: typeof route.meta?.auth === 'object'
|
||||
? route.meta.auth.includes(auth)
|
||||
: false
|
||||
if (typeof route.meta?.auth === 'string') {
|
||||
return route.meta.auth !== '' ? route.meta.auth === auth : true
|
||||
}
|
||||
else if (typeof route.meta?.auth === 'object') {
|
||||
return route.meta.auth.length > 0 ? route.meta.auth.includes(auth) : true
|
||||
}
|
||||
else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user