update 管理员判断调整

This commit is contained in:
赵霄
2023-11-23 09:48:02 +08:00
parent 95f94b071e
commit 025a1e8a63
5 changed files with 23 additions and 18 deletions
@@ -77,11 +77,9 @@ export default {
...mapGetters(['userInfo']),
// 是否管理员
isAdmin () {
const roleList = this.userInfo.roleCode.split(',')
if (roleList && roleList.length > 0 && roleList.some(tt => tt === 'admin')) {
return true
}
return false
const adminRoleList = window._CONFIG.adminRoleCode.split(',')
const userRoleList = this.userInfo.roleCode.split(',')
return userRoleList.some(tt => adminRoleList.includes(tt))
}
},
data () {