Merge remote-tracking branch 'origin/main'

This commit is contained in:
qiaoqinzheng 2023-05-15 09:37:26 +08:00
commit 8a0303b065

View File

@ -41,6 +41,7 @@ import org.jeecg.modules.system.vo.lowapp.UpdateDepartInfo;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.annotation.Lazy;
@ -97,6 +98,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Autowired
private SysUserTenantMapper userTenantMapper;
@Value("${system.auth.defaultPassword}")
private String defaultPassword;
@Override
public Result<IPage<SysUser>> queryPageList(HttpServletRequest req, QueryWrapper<SysUser> queryWrapper, Integer pageSize, Integer pageNo) {
Result<IPage<SysUser>> result = new Result<IPage<SysUser>>();
@ -187,8 +191,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
public Result<?> changePassword(SysUser sysUser) {
String salt = oConvertUtils.randomGen(8);
sysUser.setSalt(salt);
String password = sysUser.getPassword();
String passwordEncode = PasswordUtil.encrypt(sysUser.getUsername(), password, salt);
String passwordEncode = PasswordUtil.encrypt(sysUser.getUsername(), defaultPassword, salt);
sysUser.setPassword(passwordEncode);
this.userMapper.updateById(sysUser);
return Result.ok("密码修改成功!");