正在显示
1 个修改的文件
包含
19 行增加
和
2 行删除
| @@ -168,7 +168,14 @@ class ProjectAssociationServices extends BaseService | @@ -168,7 +168,14 @@ 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()->post($url, $param)->json(); |
| 172 | + $client = new \GuzzleHttp\Client(); | ||
| 173 | + $result = $client->request('POST', $url, [ | ||
| 174 | + 'proxy' => env('CURL_PROXY'), | ||
| 175 | + 'json' => $param, | ||
| 176 | + 'verify' => false, | ||
| 177 | + ])->getBody()->getContents(); | ||
| 178 | + $result = json_decode($result, true); | ||
| 172 | if(empty($result) || $result['status'] != 200){ | 179 | if(empty($result) || $result['status'] != 200){ |
| 173 | return []; | 180 | return []; |
| 174 | } | 181 | } |
| @@ -189,7 +196,17 @@ class ProjectAssociationServices extends BaseService | @@ -189,7 +196,17 @@ class ProjectAssociationServices extends BaseService | ||
| 189 | ]; | 196 | ]; |
| 190 | $param['sign'] = $this->getSign($param); | 197 | $param['sign'] = $this->getSign($param); |
| 191 | $url = 'https://hub.ai.cc/api/globalso_ai_customer_service/send_msg'; | 198 | $url = 'https://hub.ai.cc/api/globalso_ai_customer_service/send_msg'; |
| 192 | - $result = Http::withoutVerifying()->post($url, $param)->json(); | 199 | + |
| 200 | +// $result = Http::withoutVerifying()->post($url, $param)->json(); | ||
| 201 | + | ||
| 202 | + $client = new \GuzzleHttp\Client(); | ||
| 203 | + $result = $client->request('POST', $url, [ | ||
| 204 | + 'proxy' => env('CURL_PROXY'), | ||
| 205 | + 'json' => $param, | ||
| 206 | + 'verify' => false, | ||
| 207 | + ])->getBody()->getContents(); | ||
| 208 | + $result = json_decode($result, true); | ||
| 209 | + | ||
| 193 | if(empty($result) || $result['status'] != 200){ | 210 | if(empty($result) || $result['status'] != 200){ |
| 194 | throw new \Exception($result['message'] ?? ''); | 211 | throw new \Exception($result['message'] ?? ''); |
| 195 | } | 212 | } |
-
请 注册 或 登录 后发表评论