From 8eb380ba262c1aea56630ecfd8b0949bdcee89fd Mon Sep 17 00:00:00 2001 From: xumin Date: Tue, 21 Jun 2022 09:46:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=BB=E6=84=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AF=86=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java index eef2466b..4ef37bd2 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java @@ -38,6 +38,7 @@ import com.pig4cloud.pig.common.core.constant.enums.MenuTypeEnum; import com.pig4cloud.pig.common.core.exception.ErrorCodes; import com.pig4cloud.pig.common.core.util.MsgUtils; import com.pig4cloud.pig.common.core.util.R; +import com.pig4cloud.pig.common.security.util.SecurityUtils; import com.pig4cloud.plugin.excel.vo.ErrorMessage; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -172,7 +173,8 @@ public class SysUserServiceImpl extends ServiceImpl impl @Override @CacheEvict(value = CacheConstants.USER_DETAILS, key = "#userDto.username") public Boolean updateUserInfo(UserDTO userDto) { - UserVO userVO = baseMapper.getUserVoByUsername(userDto.getUsername()); + String username = SecurityUtils.getUser().getUsername(); + UserVO userVO = baseMapper.getUserVoByUsername(username); Assert.isTrue(ENCODER.matches(userDto.getPassword(), userVO.getPassword()), MsgUtils.getMessage(ErrorCodes.SYS_USER_UPDATE_PASSWORDERROR));