diff --git a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/impl/SysUserServiceImpl.java b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/impl/SysUserServiceImpl.java index b9a568418..dfb408c7c 100644 --- a/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/impl/SysUserServiceImpl.java +++ b/kernel-s-system/system-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/user/service/impl/SysUserServiceImpl.java @@ -310,11 +310,14 @@ public class SysUserServiceImpl extends ServiceImpl impl throw new ServiceException(SysUserExceptionEnum.USER_PWD_ERROR); } + // 将密码进行空字符串处理 + String password = sysUserRequest.getNewPassword().trim(); + // 校验新密码规则,根据密码策略 - securityConfigService.validatePasswordSecurityRule(true, sysUserRequest.getNewPassword()); + securityConfigService.validatePasswordSecurityRule(true, password); // 设置新的加密后密码和盐 - SaltedEncryptResult saltedEncryptResult = passwordStoredEncryptApi.encryptWithSalt(sysUserRequest.getNewPassword()); + SaltedEncryptResult saltedEncryptResult = passwordStoredEncryptApi.encryptWithSalt(password); sysUser.setPassword(saltedEncryptResult.getEncryptPassword()); sysUser.setPasswordSalt(saltedEncryptResult.getPasswordSalt());