cqp hai 3 días
pai
achega
ba3f8d66c1
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  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_HTTPHEADER, $header);
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
         curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
         curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
+        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
 
 
         if(!is_null($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
         if(!is_null($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
         $r = curl_exec($ch);
         $r = curl_exec($ch);
@@ -507,8 +508,11 @@ class TestService extends Service
         }
         }
         curl_close($ch);
         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){
     public function get_helper($url,$header=[],$timeout = 20){