Commit 9a12d2fd authored by 刘小敏's avatar 刘小敏

debug xhs

parent 4eab16dc
...@@ -441,6 +441,9 @@ class ConversionService ...@@ -441,6 +441,9 @@ class ConversionService
private function httpPostJson($url, $data, $headers = []) private function httpPostJson($url, $data, $headers = [])
{ {
try { try {
custom_log('[xhs.api666] 接口入参 url :'.$url.' | body:'.json_encode($data).' | headers:'.json_encode($headers), 0, 'xhs_ad');
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POST, true);
...@@ -456,17 +459,17 @@ class ConversionService ...@@ -456,17 +459,17 @@ class ConversionService
curl_close($ch); curl_close($ch);
if ($error) { if ($error) {
custom_log('[xhs.api] curl error: ' . $error, 0, 'xhs_ad', 'error'); custom_log('[xhs.api666] curl error: ' . $error, 0, 'xhs_ad');
return null; return null;
} }
if ($httpCode != 200) { if ($httpCode != 200) {
custom_log('[xhs.api] http error: ' . $httpCode . ', body=' . substr($result, 0, 500), 0, 'xhs_ad', 'error'); custom_log('[xhs.api666] http error: ' . $httpCode . ', body=' . substr($result, 0, 500), 0, 'xhs_ad');
} }
return json_decode($result, true) ?: null; return json_decode($result, true) ?: null;
} catch (\Exception $e) { } catch (\Exception $e) {
custom_log('[xhs.api] POST JSON 请求异常: ' . $e->getMessage(), 0, 'xhs_ad', 'error'); custom_log('[xhs.api666] POST JSON 请求异常: ' . $e->getMessage(), 0, 'xhs_ad');
return null; return null;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment