cqp 3 дней назад
Родитель
Сommit
ba3f8d66c1
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      app/Service/TestService.php

+ 6 - 2
app/Service/TestService.php

@@ -491,6 +491,7 @@ class TestService extends Service
         curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
         curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
+        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
 
         if(!is_null($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
         $r = curl_exec($ch);
@@ -507,8 +508,11 @@ class TestService extends Service
         }
         curl_close($ch);
 
-        Log::channel('apiLog')->info($title . 'POST结果', ["message" => json_decode($r, true) ]);
-        return [true, json_decode($r, true)];
+        $return = json_decode($r, true);
+        unset($r);
+        Log::channel('apiLog')->info($title . 'POST结果', ["message" => $return ]);
+
+        return [true, $return];
     }
 
     public function get_helper($url,$header=[],$timeout = 20){