rkljw 2 달 전
부모
커밋
79c7b02730
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      app/JsonRpc/NewsService.php

+ 3 - 0
app/JsonRpc/NewsService.php

@@ -114,6 +114,9 @@ class NewsService implements NewsServiceInterface
      */
     public function addCategory(array $data): array
     {
+        if(isset($data['id'])){
+            unset($data['id']);
+        }
         $id = Category::insertGetId($data);
         if (empty($id)) {
             return Result::error("添加失败");