mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-19 11:40:05 +08:00
解决前端头像不展示的问题
This commit is contained in:
parent
64b085ae0d
commit
5dd51018bd
@ -53,7 +53,7 @@ const user = {
|
|||||||
getInfo(state.token).then(res => {
|
getInfo(state.token).then(res => {
|
||||||
res = res.data; // 读取 data 数据
|
res = res.data; // 读取 data 数据
|
||||||
const user = res.user
|
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是否是一个非空数组
|
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||||
commit('SET_ROLES', res.roles)
|
commit('SET_ROLES', res.roles)
|
||||||
commit('SET_PERMISSIONS', res.permissions)
|
commit('SET_PERMISSIONS', res.permissions)
|
||||||
|
Loading…
Reference in New Issue
Block a user