作者 allworldg
提交者 Gitee

update ruoyi-ui/src/views/system/user/profile/userAvatar.vue.

1 <template> 1 <template>
2 <div> 2 <div>
3 <div class="user-info-head" @click="editCropper()"><img v-bind:src="options.img" title="点击上传头像" class="img-circle img-lg" /></div> 3 <div class="user-info-head" @click="editCropper()"><img v-bind:src="options.img" title="点击上传头像" class="img-circle img-lg" /></div>
4 - <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened"> 4 + <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened" @close="closeDialog()">
5 <el-row> 5 <el-row>
6 <el-col :xs="24" :md="12" :style="{height: '350px'}"> 6 <el-col :xs="24" :md="12" :style="{height: '350px'}">
7 <vue-cropper 7 <vue-cropper
@@ -136,6 +136,10 @@ export default { @@ -136,6 +136,10 @@ export default {
136 // 实时预览 136 // 实时预览
137 realTime(data) { 137 realTime(data) {
138 this.previews = data; 138 this.previews = data;
  139 + },
  140 + //取消截图,关闭对话框
  141 + closeDialog() {
  142 + this.options.img = store.getters.avatar
139 } 143 }
140 } 144 }
141 }; 145 };