fix 头像上传 未走OSS存储问题

This commit is contained in:
疯狂的狮子li
2021-08-04 13:10:28 +08:00
parent 0ec756cf58
commit 01e8fe5ddb
2 changed files with 6 additions and 3 deletions

View File

@ -51,7 +51,7 @@ const user = {
return new Promise((resolve, reject) => {
getInfo().then(res => {
const user = res.data.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.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.data.roles)
commit('SET_PERMISSIONS', res.data.permissions)