From c813046594b82230cd2cb61622d68a4981096e08 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期一, 02 八月 2021 19:28:41 +0800
Subject: [PATCH] update 日常校验 统一重构到 StringUtils 便于维护扩展
---
ruoyi-ui/src/views/system/user/profile/userAvatar.vue | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/ruoyi-ui/src/views/system/user/profile/userAvatar.vue b/ruoyi-ui/src/views/system/user/profile/userAvatar.vue
index deeabe7..6ed6314 100644
--- a/ruoyi-ui/src/views/system/user/profile/userAvatar.vue
+++ b/ruoyi-ui/src/views/system/user/profile/userAvatar.vue
@@ -1,7 +1,7 @@
<template>
<div>
<div class="user-info-head" @click="editCropper()"><img v-bind:src="options.img" title="鐐瑰嚮涓婁紶澶村儚" class="img-circle img-lg" /></div>
- <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened">
+ <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened" @close="closeDialog()">
<el-row>
<el-col :xs="24" :md="12" :style="{height: '350px'}">
<vue-cropper
@@ -27,7 +27,7 @@
<el-col :lg="2" :md="2">
<el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload">
<el-button size="small">
- 涓婁紶
+ 閫夋嫨
<i class="el-icon-upload el-icon--right"></i>
</el-button>
</el-upload>
@@ -126,7 +126,7 @@
formData.append("avatarfile", data);
uploadAvatar(formData).then(response => {
this.open = false;
- this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
+ this.options.img = process.env.VUE_APP_BASE_API + response.data.imgUrl;
store.commit('SET_AVATAR', this.options.img);
this.msgSuccess("淇敼鎴愬姛");
this.visible = false;
@@ -136,6 +136,11 @@
// 瀹炴椂棰勮
realTime(data) {
this.previews = data;
+ },
+ // 鍏抽棴绐楀彛
+ closeDialog() {
+ this.options.img = store.getters.avatar
+ this.visible = false;
}
}
};
@@ -144,6 +149,7 @@
.user-info-head {
position: relative;
display: inline-block;
+ height: 120px;
}
.user-info-head:hover:after {
@@ -163,4 +169,4 @@
line-height: 110px;
border-radius: 50%;
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.3