aleyds 11 months ago
parent
commit
136402e82d
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/myComponents/uploadImg.vue
  2. 1 1
      src/store/modules/user.js

+ 2 - 2
src/myComponents/uploadImg.vue

@@ -144,7 +144,7 @@ export default {
         formData.append("avatarfile", data, this.options.filename);
         uploadAvatar(formData).then(response => {
           this.open = false;
-          this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
+          this.options.img =  response.imgUrl;
           store.commit('SET_AVATAR', this.options.img);
           this.$modal.msgSuccess("修改成功");
           this.visible = false;
@@ -172,7 +172,7 @@ export default {
         }else if(typeof newValue == "string") {
           console.log("范德萨发顺丰afgasdfasdfasdf===",newValue)
           this.options.img = newValue
-        } 
+        }
       }
     }
   }

+ 1 - 1
src/store/modules/user.js

@@ -63,7 +63,7 @@ const user = {
       return new Promise((resolve, reject) => {
         getInfo().then(res => {
           const user = res.user
-          const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
+          const avatar = (user.avatar == "" || user.avatar == null) ? 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)