修复用户昵称显示与登录跳转问题

This commit is contained in:
2022-12-01 17:30:26 +08:00
parent 2e1b5ce5ac
commit 5573b0c02b
2 changed files with 4 additions and 3 deletions

View File

@@ -85,10 +85,10 @@ export const logOut = (commit) => {
export const setUserInfo = (res, commit) => {
// 如果没有任何权限,则赋予一个默认的权限,避免请求死循环
if (res.roles.length === 0) {
if (res.permissions.length === 0) {
commit('SET_ROLES', ['ROLE_SYSTEM_DEFAULT'])
} else {
commit('SET_ROLES', res.roles)
commit('SET_ROLES', res.permissions)
}
commit('SET_USER', res.user)
}