diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index 898f42a0..691de74d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -197,7 +197,10 @@ public class SysUserController extends BaseController user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt())); if (userService.resetUserPwd(user) > 0) { - ShiroUtils.setSysUser(userService.selectUserById(user.getUserId())); + if (ShiroUtils.getUserId() == user.getUserId()) + { + ShiroUtils.setSysUser(userService.selectUserById(user.getUserId())); + } return success(); } return error();