解决前端头像不展示的问题
parent
64b085ae0d
commit
5dd51018bd
|
@ -53,7 +53,7 @@ const user = {
|
|||
getInfo(state.token).then(res => {
|
||||
res = res.data; // 读取 data 数据
|
||||
const user = res.user
|
||||
const avatar = user.avatar === "" ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
|
||||
const avatar = user.avatar === "" ? require("@/assets/images/profile.jpg") : user.avatar;
|
||||
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||
commit('SET_ROLES', res.roles)
|
||||
commit('SET_PERMISSIONS', res.permissions)
|
||||
|
|
Loading…
Reference in New Issue