登录跳转
This commit is contained in:
@@ -89,13 +89,12 @@ export const logOut = (commit) => {
|
||||
|
||||
export const setUserInfo = (res, commit) => {
|
||||
// 如果没有任何权限,则赋予一个默认的权限,避免请求死循环
|
||||
if (res.roles.length === 0) {
|
||||
if (res.roles && res.roles.length > 0) {
|
||||
commit('SET_ROLES', res.roles)
|
||||
} else if (res.permissions.length === 0) {
|
||||
commit('SET_ROLES', ['ROLE_SYSTEM_DEFAULT'])
|
||||
} else {
|
||||
commit('SET_ROLES', res.roles)
|
||||
}
|
||||
if (res.depts && res.roles.length > 0) {
|
||||
commit('SET_DEPTS', res.depts)
|
||||
commit('SET_ROLES', res.permissions)
|
||||
}
|
||||
commit('SET_USER', res.user)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user