From fa84adbfe301b6be1fbe9f3535ca8e68779d93c8 Mon Sep 17 00:00:00 2001 From: Wang YiHang <3060234389@qq.com> Date: Mon, 9 Sep 2024 16:57:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=88=97=E8=A1=A8=E5=87=BA?= =?UTF-8?q?=E6=9D=A5=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../market/controller/SysApitypeController.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cloud-market-server/src/main/java/com/muyu/market/controller/SysApitypeController.java b/cloud-market-server/src/main/java/com/muyu/market/controller/SysApitypeController.java index 87ea648..504a111 100644 --- a/cloud-market-server/src/main/java/com/muyu/market/controller/SysApitypeController.java +++ b/cloud-market-server/src/main/java/com/muyu/market/controller/SysApitypeController.java @@ -131,10 +131,15 @@ public class SysApitypeController extends BaseController return JavaGetConfig.standing(standing); } + @PostMapping("/abc") + public static Long abc(){ + return SecurityUtils.getUserId(); + } + @PostMapping("/addUserRole/{res}") - public Result updateCreateByUserId(@PathVariable("res") Integer res) { - Long userId = SecurityUtils.getUserId(); + public Result updateCreateByUserId(@PathVariable(value = "res") Integer res) { + Long userId = abc(); UserRole userRole = sysApitypeService.selectUserRoleByUserId(userId); if(res!=1||userRole!=null){ return Result.error(); @@ -142,8 +147,4 @@ public class SysApitypeController extends BaseController return Result.success(sysApitypeService.insertUserRole(userId)); } - @PostMapping("/abc") - public Long abc(){ - return SecurityUtils.getUserId(); - } }