From b4048fbe80dba8e7756ae557a15ab60b4f80a44b Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期二, 04 四月 2023 09:09:07 +0800 Subject: [PATCH] 合并开源主线 --- src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java | 15 +++++++++++++-- 1 files changed, 13 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 d23b03c..37f9aba 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 @@ 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); } @@ -205,4 +205,15 @@ } } } + + @PostMapping("/userInfo") + @Operation(summary = "绠$悊鍛樹慨鏀规櫘閫氱敤鎴峰瘑鐮�") + public LoginUser getUserInfo() { + // 鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛id + LoginUser userInfo = SecurityUtils.getUserInfo(); + if (userInfo == null) { + throw new ControllerException(ErrorCode.ERROR100); + } + return userInfo; + } } -- Gitblit v1.8.0