admin模块用户信息修改添加新密码是否为空的判断

This commit is contained in:
刘海涛 2021-03-05 17:58:07 +08:00
parent bb3af11637
commit 1e03d34996
1 changed files with 4 additions and 1 deletions

View File

@ -48,6 +48,7 @@ import org.springframework.util.Assert;
import java.time.LocalDateTime;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
@ -160,7 +161,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
Assert.isTrue(ENCODER.matches(userDto.getPassword(), userVO.getPassword()), "原密码错误,修改失败");
SysUser sysUser = new SysUser();
sysUser.setPassword(ENCODER.encode(userDto.getNewpassword1()));
if (StrUtil.isNotBlank(userDto.getNewpassword1())) {
sysUser.setPassword(ENCODER.encode(userDto.getNewpassword1()));
}
sysUser.setPhone(userDto.getPhone());
sysUser.setUserId(userVO.getUserId());
sysUser.setAvatar(userDto.getAvatar());