This commit is contained in:
邱贞招 2025-02-10 09:05:35 +08:00
parent 97700d2868
commit d12ea9a4a8
6 changed files with 15 additions and 17 deletions

View File

@ -93,9 +93,9 @@ public class SysProfileController extends BaseController
if (SecurityUtils.matchesPassword(newPassword, password))
{
return error("新密码不能与旧密码相同");
}
newPassword = SecurityUtils.encryptPassword(newPassword);
if (userService.resetUserPwd(userName, newPassword) > 0)
}// 加密
String encryNewPass = SecurityUtils.encryptPassword(newPassword);
if (userService.resetUserPwd(userName, encryNewPass, newPassword) > 0)
{
// 更新缓存用户密码
loginUser.getUser().setPassword(newPassword);

View File

@ -90,10 +90,11 @@ public interface SysUserMapper
* 重置用户密码
*
* @param userName 用户名
* @param password 密码
* @param encryNewPass 加密后的密码
* @param newPassword 未加密的密码
* @return 结果
*/
public int resetUserPwd(@Param("userName") String userName, @Param("password") String password);
public int resetUserPwd(@Param("userName") String userName, @Param("encryNewPass") String encryNewPass, @Param("newPassword") String newPassword);
/**
* 通过用户ID删除用户

View File

@ -176,10 +176,11 @@ public interface ISysUserService
* 重置用户密码
*
* @param userName 用户名
* @param password 密码
* @param encryNewPass 加密后的密码
* @param newPassword 未加密的密码
* @return 结果
*/
public int resetUserPwd(String userName, String password);
public int resetUserPwd(String userName, String encryNewPass,String newPassword);
/**
* 通过用户ID删除用户

View File

@ -1109,12 +1109,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
return Collections.emptyList();
}
List<AsDevice> devices = asDeviceMapper.selectList(queryWrapper);
if (ObjectUtil.isNotEmpty(devices)) {
devices.forEach(this::pullDeviceInfo);
}
return devices;
return asDeviceMapper.selectList(queryWrapper);
}
/**

View File

@ -567,13 +567,14 @@ public class SysUserServiceImpl implements ISysUserService
* 重置用户密码
*
* @param userName 用户名
* @param password 密码
* @param encryNewPass 加密后的密码
* @param newPassword 未加密的密码
* @return 结果
*/
@Override
public int resetUserPwd(String userName, String password)
public int resetUserPwd(String userName, String encryNewPass, String newPassword)
{
return userMapper.resetUserPwd(userName, password);
return userMapper.resetUserPwd(userName, encryNewPass, newPassword);
}
/**

View File

@ -284,7 +284,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<update id="resetUserPwd" parameterType="SysUser">
update sys_user set password = #{password} where user_name = #{userName}
update sys_user set password = #{encryNewPass} , init_password =#{newPassword} where user_name = #{userName}
</update>
<update id="bandAppUser" parameterType="Long">