diff --git a/src/main/java/club/joylink/xiannccda/controller/RoleAuthController.java b/src/main/java/club/joylink/xiannccda/controller/RoleAuthController.java index bda1310..0468de7 100644 --- a/src/main/java/club/joylink/xiannccda/controller/RoleAuthController.java +++ b/src/main/java/club/joylink/xiannccda/controller/RoleAuthController.java @@ -75,6 +75,7 @@ public class RoleAuthController { @PostMapping("/role/saveOrUpdate") @Operation(summary = "角色编辑") @ApiResponse(description = "角色编辑") + @SecurityRequirement(name = "jwt") public void roleSaveOrUpdate(@RequestBody AuthRoleDTO dto) { this.authService.saveOrUpdate(dto); } diff --git a/src/main/java/club/joylink/xiannccda/dto/auth/AuthRoleDTO.java b/src/main/java/club/joylink/xiannccda/dto/auth/AuthRoleDTO.java index b005e41..34570ab 100644 --- a/src/main/java/club/joylink/xiannccda/dto/auth/AuthRoleDTO.java +++ b/src/main/java/club/joylink/xiannccda/dto/auth/AuthRoleDTO.java @@ -2,6 +2,7 @@ package club.joylink.xiannccda.dto.auth; import club.joylink.xiannccda.entity.AuthRole; import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; +import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.List; import lombok.Data; @@ -11,5 +12,6 @@ public class AuthRoleDTO { private Long id; private String name; private List resList; + @JsonIgnore private String apiIds; } diff --git a/src/main/java/club/joylink/xiannccda/service/AuthService.java b/src/main/java/club/joylink/xiannccda/service/AuthService.java index a74a73f..5087209 100644 --- a/src/main/java/club/joylink/xiannccda/service/AuthService.java +++ b/src/main/java/club/joylink/xiannccda/service/AuthService.java @@ -42,8 +42,9 @@ public class AuthService { if (Objects.isNull(dto.getId())) { AuthRole r = new AuthRole(); r.setName(dto.getName()); + this.authRoleRepository.save(r); - this.batchSave(dto.getResList(), dto.getId()); + this.batchSave(dto.getResList(), r.getId()); } else { AuthRole r = this.authRoleRepository.getById(dto.getId()); BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(r));