解决前端头像不展示的问题

pull/2/head
YunaiV 2021-03-21 20:41:32 +08:00
parent 64b085ae0d
commit 5dd51018bd
1 changed files with 1 additions and 1 deletions

View File

@ -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)