From e593b6ce3469549fb976cf0a2b5756e6a081c66f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E5=87=AF?= <371894675@qq.com> Date: Fri, 3 Nov 2023 10:55:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=BD=A2=E8=B1=A1=E7=85=A7=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../health/system/server/controller/SysProfileController.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base-system-server/src/main/java/com/health/system/server/controller/SysProfileController.java b/base-system-server/src/main/java/com/health/system/server/controller/SysProfileController.java index 8bab41b..dcaacbd 100644 --- a/base-system-server/src/main/java/com/health/system/server/controller/SysProfileController.java +++ b/base-system-server/src/main/java/com/health/system/server/controller/SysProfileController.java @@ -149,12 +149,15 @@ public class SysProfileController extends BaseController { */ @PostMapping("/update/avatar") public Result updateAvatar(@RequestParam("avatar") MultipartFile avatar) throws IOException { + SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); String avatarUrl=""; if (avatar.isEmpty()){ throw new ServiceException("请选择一张个人形象照进行上传"); } try { avatarUrl = OssFileUtils.ossUpd(avatar); + //修改当前登录人个人形象 + int i = userService.updateUserProfile(sysUser); return Result.success(avatarUrl,"上传成功"); } catch (Exception e) { throw new RuntimeException(e);