Browse Source

网站维护开关

lizhen_gitee 1 năm trước cách đây
mục cha
commit
4190f9822e

+ 6 - 2
application/common/controller/Api.php

@@ -81,8 +81,12 @@ class Api
         $this->request = is_null($request) ? Request::instance() : $request;
         $this->request = is_null($request) ? Request::instance() : $request;
 
 
         if(config('site.apisite_switch') == 0){
         if(config('site.apisite_switch') == 0){
-            $notice = config('site.apisite_notice') ?: '全站维护中';
-            $this->error($notice);
+            $controllername = $this->request->controller();
+
+            if(strtolower($controllername) != 'notifynew' && strtolower($controllername) != 'easemob' ){
+                $notice = config('site.apisite_notice') ?: '全站维护中';
+                $this->error($notice);
+            }
         }
         }
 
 
         // 验签
         // 验签