111
This commit is contained in:
parent
97700d2868
commit
d12ea9a4a8
electripper-admin/src/main/java/com/ruoyi/web/controller/system
electripper-system/src/main
java/com/ruoyi/system
mapper
service
resources/mapper/system
|
@ -93,9 +93,9 @@ public class SysProfileController extends BaseController
|
||||||
if (SecurityUtils.matchesPassword(newPassword, password))
|
if (SecurityUtils.matchesPassword(newPassword, password))
|
||||||
{
|
{
|
||||||
return error("新密码不能与旧密码相同");
|
return error("新密码不能与旧密码相同");
|
||||||
}
|
}// 加密
|
||||||
newPassword = SecurityUtils.encryptPassword(newPassword);
|
String encryNewPass = SecurityUtils.encryptPassword(newPassword);
|
||||||
if (userService.resetUserPwd(userName, newPassword) > 0)
|
if (userService.resetUserPwd(userName, encryNewPass, newPassword) > 0)
|
||||||
{
|
{
|
||||||
// 更新缓存用户密码
|
// 更新缓存用户密码
|
||||||
loginUser.getUser().setPassword(newPassword);
|
loginUser.getUser().setPassword(newPassword);
|
||||||
|
|
|
@ -90,10 +90,11 @@ public interface SysUserMapper
|
||||||
* 重置用户密码
|
* 重置用户密码
|
||||||
*
|
*
|
||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
* @param password 密码
|
* @param encryNewPass 加密后的密码
|
||||||
|
* @param newPassword 未加密的密码
|
||||||
* @return 结果
|
* @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删除用户
|
* 通过用户ID删除用户
|
||||||
|
|
|
@ -176,10 +176,11 @@ public interface ISysUserService
|
||||||
* 重置用户密码
|
* 重置用户密码
|
||||||
*
|
*
|
||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
* @param password 密码
|
* @param encryNewPass 加密后的密码
|
||||||
|
* @param newPassword 未加密的密码
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int resetUserPwd(String userName, String password);
|
public int resetUserPwd(String userName, String encryNewPass,String newPassword);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户ID删除用户
|
* 通过用户ID删除用户
|
||||||
|
|
|
@ -1109,12 +1109,7 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
List<AsDevice> devices = asDeviceMapper.selectList(queryWrapper);
|
return asDeviceMapper.selectList(queryWrapper);
|
||||||
if (ObjectUtil.isNotEmpty(devices)) {
|
|
||||||
devices.forEach(this::pullDeviceInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
return devices;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -567,13 +567,14 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
* 重置用户密码
|
* 重置用户密码
|
||||||
*
|
*
|
||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
* @param password 密码
|
* @param encryNewPass 加密后的密码
|
||||||
|
* @param newPassword 未加密的密码
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -284,7 +284,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="resetUserPwd" parameterType="SysUser">
|
<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>
|
||||||
|
|
||||||
<update id="bandAppUser" parameterType="Long">
|
<update id="bandAppUser" parameterType="Long">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user