作者 zhl

国外访问国内, 添加代理

... ... @@ -41,6 +41,7 @@ class Flow extends Command
public function handle()
{
$this->cdnStatistics();
return true;
}
public function cdnStatistics()
... ...
... ... @@ -168,7 +168,7 @@ 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()->withOptions(['proxy' => env('CURL_PROXY')])->post($url, $param)->json();
if(empty($result) || $result['status'] != 200){
return [];
}
... ... @@ -189,7 +189,7 @@ class ProjectAssociationServices extends BaseService
];
$param['sign'] = $this->getSign($param);
$url = 'https://hub.ai.cc/api/globalso_ai_customer_service/send_msg';
$result = Http::withoutVerifying()->timeout(30)->post($url, $param)->json();
$result = Http::withoutVerifying()->withOptions(['proxy' => env('CURL_PROXY')])->timeout(30)->post($url, $param)->json();
if(empty($result) || $result['status'] != 200){
throw new \Exception($result['message'] ?? '');
}
... ...