Browse Source

api记录日志的方式

lizhen_gitee 3 months ago
parent
commit
60a861e8e6

+ 1 - 0
application/api/controller/User.php

@@ -137,6 +137,7 @@ class User extends Api
      * 微信内H5-JSAPI支付
      */
     public function jssdkBuildConfig() {
+        $this->success("获取成功!",'123456');
         $url = $this->request->request("url");
         $wechat = new \app\common\library\Wechatshare;
         $sign = $wechat->getSignPackage(urldecode($url));

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

@@ -33,7 +33,7 @@ class ExceptionHandle extends Handle
             $msg = '网络开小差了';
             $result = ['code' => $code, 'msg' => $msg, 'time' => time(), 'data' => null];
 
-            $logType = 1;
+            $logType = 2;
             if ($logType == 1){
                 LogUtil::error('result','Api-Middleware-Log','request_log',$result);
                 LogUtil::error('ExceptionMsg','Api-Middleware-Log','request_log',$e->getMessage());