浏览代码

api记录日志的方式

lizhen_gitee 4 月之前
父节点
当前提交
60a861e8e6
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. 1 0
      application/api/controller/User.php
  2. 1 1
      application/api/library/ExceptionHandle.php

+ 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());