Commit 79539864 authored by 杨硕's avatar 杨硕

优化自定义按钮

parent c1e07acf
......@@ -61,10 +61,10 @@ const user = {
const avatar = user.avatar === null ? require('@/assets/image/profile.jpg') : user.avatar
if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.data.roles)
commit('SET_PERMISSIONS', res.data.permissions)
} else {
commit('SET_ROLES', ['ROLE_DEFAULT'])
}
commit('SET_PERMISSIONS', res.data.permissions)
commit('SET_NAME', user.username)
commit('SET_SPECIALTAG', user.specialTag)
commit('SET_AVATAR', avatar)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment