Commit ccbef9b5331eab2a9389bb017d8016b996c4b5dd

Authored by 逐浪人
Committed by GitHub
1 parent 2c3f6417

Update UserController.java

修复修改密码报错,传递id参数为0的bug
src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java
@@ -83,8 +83,8 @@ public class UserController { @@ -83,8 +83,8 @@ public class UserController {
83 if (user == null) { 83 if (user == null) {
84 throw new ControllerException(ErrorCode.ERROR100); 84 throw new ControllerException(ErrorCode.ERROR100);
85 } 85 }
86 - int userId = SecurityUtils.getUserId();  
87 - boolean result = userService.changePassword(userId, DigestUtils.md5DigestAsHex(password.getBytes())); 86 + //int userId = SecurityUtils.getUserId();
  87 + boolean result = userService.changePassword(user.getId(), DigestUtils.md5DigestAsHex(password.getBytes()));
88 if (!result) { 88 if (!result) {
89 throw new ControllerException(ErrorCode.ERROR100); 89 throw new ControllerException(ErrorCode.ERROR100);
90 } 90 }