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")