浏览代码

模拟请求

gorden 9 月之前
父节点
当前提交
2c11085282
共有 1 个文件被更改,包括 5 次插入1 次删除
  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;
     }