Forráskód Böngészése

修改销售头像

ct 3 napja
szülő
commit
42e5ca6ff0
1 módosított fájl, 5 hozzáadás és 3 törlés
  1. 5 3
      src/views/company/companyUser/profile/userAvatar.vue

+ 5 - 3
src/views/company/companyUser/profile/userAvatar.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <img v-bind:src="options.img" @click="editCropper()" title="点击上传头像" class="img-circle img-lg" />
+    <img v-bind:src="user.avatar" @click="editCropper()" title="点击上传头像" class="img-circle img-lg" />
     <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened">
       <el-row>
         <el-col :xs="24" :md="12" :style="{height: '350px'}">
@@ -61,6 +61,7 @@ export default {
   components: { VueCropper },
   props: {
     user: {
+      avatar: Object,
       type: Object
     }
   },
@@ -127,7 +128,8 @@ export default {
         uploadAvatar(formData).then(response => {
           if (response.code === 200) {
             this.open = false;
-            this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
+            this.options.img = response.imgUrl;
+            this.user.avatar = response.imgUrl;
             store.commit('SET_AVATAR', this.options.img);
             this.msgSuccess("修改成功");
           }
@@ -141,4 +143,4 @@ export default {
     }
   }
 };
-</script>
+</script>