Browse Source

模拟请求

gorden 5 months ago
parent
commit
2c11085282
1 changed files with 5 additions and 1 deletions
  1. 5 1
      app/functions.php

+ 5 - 1
app/functions.php

@@ -44,7 +44,11 @@ if (!function_exists('http_post_json')) {
         $output = curl_exec($ch);
         curl_close($ch);
         // 写日志
-        \support\Log::info('模拟请求:',json_decode($output,true));
+        if (is_json($output)) {
+            \support\Log::info('模拟请求:', json_decode($output, true));
+        } else {
+            \support\Log::info('模拟请求,返回异常:', ['msg' => (string)$output]);
+        }
 
         return $output;
     }