【8.0.1】【system】新增用户增加密码规则校验

pull/57/head
fengshuonan 2023-10-05 16:56:00 +08:00
parent 0564215fe9
commit 08c1d34256
1 changed files with 5 additions and 1 deletions

View File

@ -83,8 +83,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
SysUser sysUser = new SysUser();
BeanUtil.copyProperties(sysUserRequest, sysUser);
// 校验密码是否符合规则
String password = sysUserRequest.getPassword().trim();
securityConfigService.validatePasswordSecurityRule(false, password);
// 将密码加密存储到库中
SaltedEncryptResult saltedEncryptResult = passwordStoredEncryptApi.encryptWithSalt(sysUser.getPassword());
SaltedEncryptResult saltedEncryptResult = passwordStoredEncryptApi.encryptWithSalt(password);
sysUser.setPassword(saltedEncryptResult.getEncryptPassword());
sysUser.setPasswordSalt(saltedEncryptResult.getPasswordSalt());