瀏覽代碼

优化,不记录日志

lizhen_gitee 1 年之前
父節點
當前提交
c49abdec07
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      application/api/library/ExceptionHandle.php
  2. 2 2
      application/common/controller/Api.php

+ 2 - 2
application/api/library/ExceptionHandle.php

@@ -32,7 +32,7 @@ class ExceptionHandle extends Handle
 
         $result = ['code' => $code, 'msg' => $msg, 'time' => time(), 'data' => null];
 
-        if (defined('API_REQUEST_LOG_TYPE') && defined('API_REQUEST_LOG_TYPE') == 1){
+        /*if (defined('API_REQUEST_LOG_TYPE') && defined('API_REQUEST_LOG_TYPE') == 1){
             LogUtil::error('result','Api-Middleware-Log','request_log',$result);
             LogUtil::error('Exception','Api-Middleware-Log','request_log',$e);
         }else{
@@ -40,7 +40,7 @@ class ExceptionHandle extends Handle
             if(defined('API_REQUEST_ID')) { //记录app正常返回结果
                 db('api_request_log')->where('id',API_REQUEST_ID)->update(['result'=>json_encode($result)]);
             }
-        }
+        }*/
 
         return json($result, $statuscode);
     }

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

@@ -91,7 +91,7 @@ class Api
         // 控制器初始化
         $this->_initialize();
         //日志
-        $this->request_log();
+        //$this->request_log();
         //用户活跃
         $this->user_active();
 
@@ -314,7 +314,7 @@ class Api
         ];
 
         //日志
-        $this->request_log_update($result);
+        //$this->request_log_update($result);
 
         // 如果未设置类型则自动判断
         $type = $type ? $type : ($this->request->param(config('var_jsonp_handler')) ? 'jsonp' : $this->responseType);