From ccbef9b5331eab2a9389bb017d8016b996c4b5dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=80=90=E6=B5=AA=E4=BA=BA?= Date: Tue, 21 Mar 2023 19:39:54 +0800 Subject: [PATCH] Update UserController.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复修改密码报错,传递id参数为0的bug --- .../com/genersoft/iot/vmp/vmanager/user/UserController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java index d23b03c4..157a3a81 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java @@ -83,8 +83,8 @@ public class UserController { if (user == null) { throw new ControllerException(ErrorCode.ERROR100); } - int userId = SecurityUtils.getUserId(); - boolean result = userService.changePassword(userId, DigestUtils.md5DigestAsHex(password.getBytes())); + //int userId = SecurityUtils.getUserId(); + boolean result = userService.changePassword(user.getId(), DigestUtils.md5DigestAsHex(password.getBytes())); if (!result) { throw new ControllerException(ErrorCode.ERROR100); }