From fee66fde68610850d4c8c52df022b9d53a0cd3f7 Mon Sep 17 00:00:00 2001
From: zhangfeng <1603559716@qq.com>
Date: 星期三, 21 九月 2022 14:40:34 +0800
Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/safePlatform-out into zf
---
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