作者 zhl

国外访问国内, 添加代理

@@ -41,6 +41,7 @@ class Flow extends Command @@ -41,6 +41,7 @@ class Flow extends Command
41 public function handle() 41 public function handle()
42 { 42 {
43 $this->cdnStatistics(); 43 $this->cdnStatistics();
  44 + return true;
44 } 45 }
45 46
46 public function cdnStatistics() 47 public function cdnStatistics()
@@ -168,7 +168,7 @@ class ProjectAssociationServices extends BaseService @@ -168,7 +168,7 @@ class ProjectAssociationServices extends BaseService
168 } 168 }
169 $param['sign'] = $this->getSign($param); 169 $param['sign'] = $this->getSign($param);
170 $url = 'https://hub.ai.cc/api/globalso_ai_customer_service/chatroom_list'; 170 $url = 'https://hub.ai.cc/api/globalso_ai_customer_service/chatroom_list';
171 - $result = Http::withoutVerifying()->post($url, $param)->json(); 171 + $result = Http::withoutVerifying()->withOptions(['proxy' => env('CURL_PROXY')])->post($url, $param)->json();
172 if(empty($result) || $result['status'] != 200){ 172 if(empty($result) || $result['status'] != 200){
173 return []; 173 return [];
174 } 174 }
@@ -189,7 +189,7 @@ class ProjectAssociationServices extends BaseService @@ -189,7 +189,7 @@ class ProjectAssociationServices extends BaseService
189 ]; 189 ];
190 $param['sign'] = $this->getSign($param); 190 $param['sign'] = $this->getSign($param);
191 $url = 'https://hub.ai.cc/api/globalso_ai_customer_service/send_msg'; 191 $url = 'https://hub.ai.cc/api/globalso_ai_customer_service/send_msg';
192 - $result = Http::withoutVerifying()->timeout(30)->post($url, $param)->json(); 192 + $result = Http::withoutVerifying()->withOptions(['proxy' => env('CURL_PROXY')])->timeout(30)->post($url, $param)->json();
193 if(empty($result) || $result['status'] != 200){ 193 if(empty($result) || $result['status'] != 200){
194 throw new \Exception($result['message'] ?? ''); 194 throw new \Exception($result['message'] ?? '');
195 } 195 }