From fabd08d87d00bfdf1aacf473fd905fdd3c903ed3 Mon Sep 17 00:00:00 2001 From: songhuangfeng123 <shf18767906695@163.com> Date: 星期五, 02 九月 2022 10:10:14 +0800 Subject: [PATCH] Merge branches 'genchuang' and 'master' of https://sinanoaq.cn:8888/r/safePlatform-out into genchuang --- 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