mirror of https://gitee.com/y_project/RuoYi.git
update ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java.
缺陷修复:导入用户数据时,生成的密码没有salt码,导致无法正常登录的问题; Signed-off-by: showvim <showvim@qq.com>pull/561/head
parent
70194aee09
commit
af6aba133d
|
@ -517,7 +517,9 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
BeanValidators.validateWithException(validator, user);
|
||||
deptService.checkDeptDataScope(user.getDeptId());
|
||||
String password = configService.selectConfigByKey("sys.user.initPassword");
|
||||
user.setPassword(Md5Utils.hash(user.getLoginName() + password));
|
||||
// 设置salt,并添加进加密规则中
|
||||
user.setSalt(ShiroUtils.randomSalt());
|
||||
user.setPassword(Md5Utils.hash(user.getLoginName() + password + user.getSalt()));
|
||||
user.setCreateBy(operName);
|
||||
userMapper.insertUser(user);
|
||||
successNum++;
|
||||
|
|
Loading…
Reference in New Issue