Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
lbw 2022-06-24 13:15:34 +08:00
commit 4407c3e70a

View File

@ -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<SysUserMapper, SysUser> 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));