From 74807cfa9637d2a0abdf83653ec19da152a6f3a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E7=8B=BC=E8=93=9D=E5=A4=A9?= Date: Thu, 7 Nov 2024 21:16:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=92=E8=89=B2=E5=8F=AF=E5=88=86?= =?UTF-8?q?=E9=85=8D=E6=9D=83=E9=99=90=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/guaiguailang/harmony/controller/AuthController.java | 4 ++++ .../com/guaiguailang/harmony/controller/SystemController.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/guaiguailang/harmony/controller/AuthController.java b/src/main/java/com/guaiguailang/harmony/controller/AuthController.java index a88dcfd..f51cd5c 100644 --- a/src/main/java/com/guaiguailang/harmony/controller/AuthController.java +++ b/src/main/java/com/guaiguailang/harmony/controller/AuthController.java @@ -20,6 +20,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.security.NoSuchAlgorithmException; +import java.util.Objects; @RestController @Tag(name="系统认证接口") @@ -146,6 +147,9 @@ public class AuthController { ) @PostMapping("/role-menu-add") public ResponseEntity addRoleMenu(@RequestBody SystemRoleMenu srm) { + if(Objects.equals(srm.getMenuId(), "") || Objects.equals(srm.getRoleId(), "")){ + return ResponseEntity.ok(ResponseResult.error("请选择合适的角色和功能")); + } return ResponseEntity.ok(authService.addRoleMenu(srm)); } } diff --git a/src/main/java/com/guaiguailang/harmony/controller/SystemController.java b/src/main/java/com/guaiguailang/harmony/controller/SystemController.java index 89534a6..e59082c 100644 --- a/src/main/java/com/guaiguailang/harmony/controller/SystemController.java +++ b/src/main/java/com/guaiguailang/harmony/controller/SystemController.java @@ -22,7 +22,7 @@ public class SystemController { @Operation( summary = "菜单 加载", - description = "加载用户拥有的菜单(用于显示在左侧)", + description = "加载用户拥有的菜单(用于显示在左侧,被删除的菜单不会加载)", tags = {"系统相关接口"} ) @GetMapping("/menu") @@ -31,7 +31,7 @@ public class SystemController { } @Operation( summary = "菜单 加载 全部", - description = "加载用户拥有的所有菜单,常常用于管理菜单", + description = "加载用户拥有的所有菜单,常常用于管理菜单(被删除的菜单也会加兹安)", tags = {"系统相关接口"} ) @GetMapping("/menu-all")