角色踢出

main
许宏杰 6 months ago
parent 89dde814d4
commit abccb79975

@ -53,6 +53,8 @@
onLoad: function() {
const systemData = this.$u.sys()
this.boxTop = (systemData.statusBarHeight + 44) * 2 + 80
this.queryParams.xiaoquId = this.dept.xiaoquId
@ -60,6 +62,19 @@
},
onShow() {
if (!this.$auth.hasRole("network")) {
uni.showToast({
title: '该角色暂无权限访问App',
icon: 'error'
})
setTimeout(() => {
this.$store.dispatch('LogOut').then(() => {
this.$tab.reLaunch('/pages/index')
})
}, 1000)
return
}
this.queryParams.pageNum = 1
this.total = 0
this.buildingList = []

@ -132,7 +132,6 @@
display: flex;
align-items: center;
height: 300rpx;
background-color: #3c96f3;
color: white;

@ -13,11 +13,12 @@ function authPermission(permission) {
}
function authRole(role) {
const super_admin = "admin"
// const super_admin = "admin"
const roles = store.getters && store.getters.roles
if (role && role.length > 0) {
return roles.some(v => {
return super_admin === v || v === role
return v.includes(role)
// return super_admin === v || v === role
})
} else {
return false

Loading…
Cancel
Save