From f1f506172a3edff8d31e4db77b8940f115660919 Mon Sep 17 00:00:00 2001 From: songhuangfeng123 <shf18767906695@163.com> Date: 星期二, 20 九月 2022 16:25:43 +0800 Subject: [PATCH] fix --- safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/UserController.java | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/UserController.java b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/UserController.java index 1573723..af1e7c5 100644 --- a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/UserController.java +++ b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/UserController.java @@ -67,7 +67,7 @@ @PreAuthorize("hasRole('ROLE_admin')") public ResultVO<String> addUser(Authentication authentication, @RequestBody AccountAddRPCReqDTO accountAddRPCReqDTO) { ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); - return accountUserService.addAccount(currentUser.getUid(), accountAddRPCReqDTO); + return accountUserService.addAccount(currentUser, accountAddRPCReqDTO); } @@ -77,9 +77,9 @@ @RequestMapping(value = "/mod", method = RequestMethod.POST) @PreAuthorize("hasRole('ROLE_admin')") - public ResultVO<String> modUser(Principal principal, @RequestBody AccountModRPCReqDTO accountModRPCReqDTO) { - String userId = principal.getName(); - return accountUserService.modAccount(Long.valueOf(userId), accountModRPCReqDTO); + public ResultVO<String> modUser(Authentication authentication, @RequestBody AccountModRPCReqDTO accountModRPCReqDTO) { + ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); + return accountUserService.modAccount(currentUser, accountModRPCReqDTO); } @@ -88,9 +88,9 @@ */ @RequestMapping(value = "/del", method = RequestMethod.POST) @PreAuthorize("hasRole('ROLE_admin')") - public ResultVO<String> delUser(Principal principal, @RequestBody JSONObject json) { + public ResultVO<String> delUser(Authentication authentication, @RequestBody JSONObject json) { Long uid = json.getLong("uid"); - String userId = principal.getName(); - return accountUserService.delAccount(Long.valueOf(userId), uid); + ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); + return accountUserService.delAccount(currentUser, uid); } } -- Gitblit v1.9.2