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(); - } }