mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-23 13:03:42 +08:00
修复任意修改密码问题
This commit is contained in:
parent
dcb61e1a63
commit
8eb380ba26
@ -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.exception.ErrorCodes;
|
||||||
import com.pig4cloud.pig.common.core.util.MsgUtils;
|
import com.pig4cloud.pig.common.core.util.MsgUtils;
|
||||||
import com.pig4cloud.pig.common.core.util.R;
|
import com.pig4cloud.pig.common.core.util.R;
|
||||||
|
import com.pig4cloud.pig.common.security.util.SecurityUtils;
|
||||||
import com.pig4cloud.plugin.excel.vo.ErrorMessage;
|
import com.pig4cloud.plugin.excel.vo.ErrorMessage;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -172,7 +173,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = CacheConstants.USER_DETAILS, key = "#userDto.username")
|
@CacheEvict(value = CacheConstants.USER_DETAILS, key = "#userDto.username")
|
||||||
public Boolean updateUserInfo(UserDTO userDto) {
|
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()),
|
Assert.isTrue(ENCODER.matches(userDto.getPassword(), userVO.getPassword()),
|
||||||
MsgUtils.getMessage(ErrorCodes.SYS_USER_UPDATE_PASSWORDERROR));
|
MsgUtils.getMessage(ErrorCodes.SYS_USER_UPDATE_PASSWORDERROR));
|
||||||
|
Loading…
Reference in New Issue
Block a user