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);