From dd37247e65374dd4ef7e8e8b9212d8f29023e301 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期一, 27 十二月 2021 09:50:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into satoken

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
index 50ba930..d0f80c7 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
@@ -11,7 +11,10 @@
 import com.ruoyi.system.domain.SysOss;
 import com.ruoyi.system.service.ISysOssService;
 import com.ruoyi.system.service.ISysUserService;
-import io.swagger.annotations.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
@@ -113,10 +116,9 @@
     public AjaxResult<Map<String, Object>> avatar(@RequestPart("avatarfile") MultipartFile file) {
         Map<String,Object> ajax = new HashMap<>();
         if (!file.isEmpty()) {
-            SysUser user = SecurityUtils.getUser();
 			SysOss oss = iSysOssService.upload(file);
 			String avatar = oss.getUrl();
-            if (userService.updateUserAvatar(user.getUserName(), avatar)) {
+            if (userService.updateUserAvatar(getUsername(), avatar)) {
                 ajax.put("imgUrl", avatar);
                 return AjaxResult.success(ajax);
             }

--
Gitblit v1.9.3