diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java index 332784f..6a900d5 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java @@ -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); diff --git a/electripper-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/electripper-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java index bbe5f82..e0ab235 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ b/electripper-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -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删除用户 diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/ISysUserService.java b/electripper-system/src/main/java/com/ruoyi/system/service/ISysUserService.java index e864c55..cd01b1e 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/ISysUserService.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/ISysUserService.java @@ -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删除用户 diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java index 06eed9c..db72108 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java @@ -1109,12 +1109,7 @@ public class AsDeviceServiceImpl extends ServiceImpl i return Collections.emptyList(); } - List devices = asDeviceMapper.selectList(queryWrapper); - if (ObjectUtil.isNotEmpty(devices)) { - devices.forEach(this::pullDeviceInfo); - } - - return devices; + return asDeviceMapper.selectList(queryWrapper); } /** diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index c175ca1..7b794c3 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -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); } /** diff --git a/electripper-system/src/main/resources/mapper/system/SysUserMapper.xml b/electripper-system/src/main/resources/mapper/system/SysUserMapper.xml index a3e36aa..0970313 100644 --- a/electripper-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -284,7 +284,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - update sys_user set password = #{password} where user_name = #{userName} + update sys_user set password = #{encryNewPass} , init_password =#{newPassword} where user_name = #{userName}