作者 赵彬吉

加代理

... ... @@ -168,7 +168,14 @@ class ProjectAssociationServices extends BaseService
}
$param['sign'] = $this->getSign($param);
$url = 'https://hub.ai.cc/api/globalso_ai_customer_service/chatroom_list';
$result = Http::withoutVerifying()->post($url, $param)->json();
// $result = Http::withoutVerifying()->post($url, $param)->json();
$client = new \GuzzleHttp\Client();
$result = $client->request('POST', $url, [
'proxy' => env('CURL_PROXY'),
'json' => $param,
'verify' => false,
])->getBody()->getContents();
$result = json_decode($result, true);
if(empty($result) || $result['status'] != 200){
return [];
}
... ... @@ -189,7 +196,17 @@ class ProjectAssociationServices extends BaseService
];
$param['sign'] = $this->getSign($param);
$url = 'https://hub.ai.cc/api/globalso_ai_customer_service/send_msg';
$result = Http::withoutVerifying()->post($url, $param)->json();
// $result = Http::withoutVerifying()->post($url, $param)->json();
$client = new \GuzzleHttp\Client();
$result = $client->request('POST', $url, [
'proxy' => env('CURL_PROXY'),
'json' => $param,
'verify' => false,
])->getBody()->getContents();
$result = json_decode($result, true);
if(empty($result) || $result['status'] != 200){
throw new \Exception($result['message'] ?? '');
}
... ...