diff --git a/src/main/java/com/rymcu/forest/web/api/product/ProductController.java b/src/main/java/com/rymcu/forest/web/api/product/ProductController.java index f54dfa0..9e84980 100644 --- a/src/main/java/com/rymcu/forest/web/api/product/ProductController.java +++ b/src/main/java/com/rymcu/forest/web/api/product/ProductController.java @@ -26,6 +26,7 @@ import javax.annotation.Resource; */ @RestController @RequestMapping("/api/v1/product") +@RequiresRoles(value = {"blog_admin", "admin"}, logical = Logical.OR) public class ProductController { @Resource @@ -38,14 +39,12 @@ public class ProductController { } @PostMapping("/post") - @RequiresRoles(value = {"blog_admin", "admin"}, logical = Logical.OR) public GlobalResult add(@RequestBody ProductDTO product) { Product newProduct = productService.postProduct(product); return GlobalResultGenerator.genSuccessResult(newProduct); } @PutMapping("/post") - @RequiresRoles(value = {"blog_admin", "admin"}, logical = Logical.OR) public GlobalResult update(@RequestBody ProductDTO product) { if (product.getIdProduct() == null || product.getIdProduct() == 0) { throw new IllegalArgumentException("产品主键参数异常!");