ZxcZxc123 há 2 anos atrás
pai
commit
a57e47c39a
1 ficheiros alterados com 9 adições e 1 exclusões
  1. 9 1
      app/system/controller/Index.php

+ 9 - 1
app/system/controller/Index.php

@@ -20,6 +20,9 @@ use app\Request;
 use app\system\controller\AuthController;
 use library\services\UtilService;
 use think\Cache;
+use think\db\exception\DataNotFoundException;
+use think\db\exception\DbException;
+use think\db\exception\ModelNotFoundException;
 
 
 class Index extends AuthController
@@ -51,7 +54,12 @@ class Index extends AuthController
     //获取所有分类列表
     public function getCateList()
     {
-        $cateList = EducationModel::getCate();
+        try {
+            $cateList = (new \app\model\api\EducationModel)->select();
+        } catch (DataNotFoundException $e) {
+        } catch (ModelNotFoundException $e) {
+        } catch (DbException $e) {
+        }
         return json($cateList);
     }
 }