liugc před 9 měsíci
rodič
revize
4e894a3385

+ 4 - 3
app/api/controller/DouYinController.php

@@ -225,8 +225,9 @@ class DouYinController extends BaseApiController
             Log::info('submitOrderNotify:'.formatLogData($params));
             $msg = is_array($params['msg'])?$params['msg']:json_decode($params['msg'],true);
             $res = DouYinService::submitOrderNotify($msg);
+            Log::info("submitOrderNotify:".formatLogData($res));
             if($res){
-                return json(["err_no"=>0,"err_tips"=>"success","data"=>$res], 200);
+                return json(["err_no"=>0,"err_tips"=>"","data"=>$res], 200);
             }
         } catch (\Exception $e) {
             return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);
@@ -245,7 +246,7 @@ class DouYinController extends BaseApiController
             Log::info('payNotify:'.formatLogData($params));
             $msg = is_array($params['msg'])?$params['msg']:json_decode($params['msg'],true);
             if(DouYinService::payNotify($msg)){
-                return json(["err_no"=>0,"err_tips"=>"success"], 200);
+                return json(["err_no"=>0,"err_tips"=>""], 200);
             }
         } catch (\Exception $e) {
             return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);
@@ -258,7 +259,7 @@ class DouYinController extends BaseApiController
             Log::info('payTailNotify:'.formatLogData($params));
             $msg = is_array($params['msg'])?$params['msg']:json_decode($params['msg'],true);
             if(DouYinService::payTailNotify($msg)){
-                return json(["err_no"=>0,"err_tips"=>"success"], 200);
+                return json(["err_no"=>0,"err_tips"=>""], 200);
             }
         } catch (\Exception $e) {
             return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);

+ 22 - 0
app/api/http/middleware/LogInfoInMiddleware.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace app\api\http\middleware;
+
+use think\facade\Log;
+use think\Request;
+
+class LogInfoInMiddleware
+{
+    /**
+     * 处理请求
+     *
+     * @param \think\Request $request
+     * @param \Closure       $next
+     * @return Response
+     */
+    public function handle(Request $request, \Closure $next)
+    {
+        Log::info($request->secureKey().':LogInfo:'.$request->pathinfo().':request_data:'.formatLogData($request->all()));
+        return $next($request);
+    }
+}

+ 23 - 0
app/api/http/middleware/LogInfoOutMiddleware.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace app\api\http\middleware;
+
+use think\facade\Log;
+use think\Request;
+
+class LogInfoOutMiddleware
+{
+    /**
+     * 处理请求
+     *
+     * @param \think\Request $request
+     * @param \Closure       $next
+     * @return Response
+     */
+    public function handle(Request $request, \Closure $next)
+    {
+        $response = $next($request);
+        Log::info($request->secureKey().':return_data:'.formatLogData($response->getData()));
+        return $response;
+    }
+}

+ 1 - 1
app/api/service/DouYinService.php

@@ -372,7 +372,7 @@ class DouYinService
                     "path" => "pages/order/detail",
                     "params" => json_encode(['order_number' => $order_number])
                 ],
-                "payNotifyUrl" => $payNotifyUrl??''
+                //"payNotifyUrl" => $payNotifyUrl??''
             ];
         } catch (\Exception $e) {
             throw new \Exception($e->getMessage());