From 33a52c81664f821f8970c47c3e51593d643d3d6a Mon Sep 17 00:00:00 2001
From: 若依 <yzz_ivy@163.com>
Date: Mon, 04 Mar 2024 09:48:41 +0800
Subject: [PATCH] !360 update ruoyi-modules/ruoyi-job/src/main/resources/mapper/job/SysJobLogMapper.xml. Merge pull request !360 from 刘继东/N/A

---
 ruoyi-ui/src/views/system/user/profile/userAvatar.vue |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/ruoyi-ui/src/views/system/user/profile/userAvatar.vue b/ruoyi-ui/src/views/system/user/profile/userAvatar.vue
index de69e47..434079d 100644
--- a/ruoyi-ui/src/views/system/user/profile/userAvatar.vue
+++ b/ruoyi-ui/src/views/system/user/profile/userAvatar.vue
@@ -70,12 +70,13 @@
       // 弹出层标题
       title: "修改头像",
       options: {
-        img: store.getters.avatar, //裁剪图片的地址
-        autoCrop: true, // 是否默认生成截图框
-        autoCropWidth: 200, // 默认生成截图框宽度
-        autoCropHeight: 200, // 默认生成截图框高度
-        fixedBox: true, // 固定截图框大小 不允许改变
-        outputType:"png" // 默认生成截图为PNG格式
+        img: store.getters.avatar,  //裁剪图片的地址
+        autoCrop: true,             // 是否默认生成截图框
+        autoCropWidth: 200,         // 默认生成截图框宽度
+        autoCropHeight: 200,        // 默认生成截图框高度
+        fixedBox: true,             // 固定截图框大小 不允许改变
+        outputType:"png",           // 默认生成截图为PNG格式
+        filename: 'avatar'          // 文件名称
       },
       previews: {},
       resizeHandler: null
@@ -125,6 +126,7 @@
         reader.readAsDataURL(file);
         reader.onload = () => {
           this.options.img = reader.result;
+          this.options.filename = file.name;
         };
       }
     },
@@ -132,10 +134,10 @@
     uploadImg() {
       this.$refs.cropper.getCropBlob(data => {
         let formData = new FormData();
-        formData.append("avatarfile", data);
+        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;

--
Gitblit v1.9.3