|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <img v-bind:src="options.img" @click="editCropper()" title="点击上传头像" class="img-lg" />
|
|
|
+ <img v-bind:src="baseUrl+options.img" slot="reference" @click="editCropper()" title="点击上传头像" class="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'}">
|
|
@@ -67,6 +67,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ baseUrl: null,
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
// 是否显示cropper
|
|
@@ -84,7 +85,8 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- // console.log(this.personal)
|
|
|
+ this.baseUrl = process.env.VUE_APP_BASE_API;
|
|
|
+ // console.log(this.baseUrl)
|
|
|
},
|
|
|
methods: {
|
|
|
// 编辑头像
|
|
@@ -131,7 +133,7 @@ export default {
|
|
|
uploadFile(formData).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
this.open = false;
|
|
|
- this.options.img = process.env.VUE_APP_BASE_API + response.fileName;
|
|
|
+ this.options.img = response.fileName;
|
|
|
this.personal.avatar = this.options.img;
|
|
|
this.msgSuccess("上传成功");
|
|
|
}
|