From 3fd60f86761662d0d8b34a6c89212b86157475db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=80=90=E6=B5=AA=E4=BA=BA?= <zhulangren@gmail.com>
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 d23b03c49..157a3a819 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);
             }