ZxcZxc123 2 years ago
parent
commit
f357bd9755
1 changed files with 8 additions and 2 deletions
  1. 8 2
      app/model/api/EducationModel.php

+ 8 - 2
app/model/api/EducationModel.php

@@ -21,7 +21,7 @@ class EducationModel extends Model
     /**
      * 获取所有分类
      *
-     * @return mixed
+     * @return \think\response\Json
      */
     public function getCate()
     {
@@ -40,7 +40,13 @@ class EducationModel extends Model
             }
         }
 
-        return array_values($tree);
+        $data = [
+            'code' => 200,
+            'msg' => 'success',
+            'data' => array_values($tree),
+        ];
+
+        return json($data);
     }
 
 //    public function getGrList($userId)