增加空判断保护
This commit is contained in:
@ -8,7 +8,7 @@ export function hasRole(app: App<Element>) {
|
||||
const { wsCache } = useCache()
|
||||
const { value } = binding
|
||||
const super_admin = 'admin'
|
||||
const roles = wsCache.get(CACHE_KEY.USER).roles
|
||||
const roles = wsCache.get(CACHE_KEY.USER)?.roles ? wsCache.get(CACHE_KEY.USER)?.roles : []
|
||||
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const roleFlag = value
|
||||
|
||||
Reference in New Issue
Block a user