正在显示
1 个修改的文件
包含
11 行增加
和
2 行删除
| @@ -35,7 +35,12 @@ class OaGlobalsoApi | @@ -35,7 +35,12 @@ class OaGlobalsoApi | ||
| 35 | public function order_info($order_id) | 35 | public function order_info($order_id) |
| 36 | { | 36 | { |
| 37 | $api_url = $this->url . '/api/order_info?token='.$this->token.'&order_id='.$order_id; | 37 | $api_url = $this->url . '/api/order_info?token='.$this->token.'&order_id='.$order_id; |
| 38 | - $res = http_get($api_url,["charset" => "UTF-8"]); | 38 | +// $res = http_get($api_url,["charset" => "UTF-8"]); |
| 39 | + $client = new \GuzzleHttp\Client(); | ||
| 40 | + $data = $client->request('GET', $api_url, [ | ||
| 41 | + 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号 | ||
| 42 | + ])->getBody()->getContents(); | ||
| 43 | + $res = json_decode($data, true); | ||
| 39 | return $res; | 44 | return $res; |
| 40 | } | 45 | } |
| 41 | 46 | ||
| @@ -53,7 +58,11 @@ class OaGlobalsoApi | @@ -53,7 +58,11 @@ class OaGlobalsoApi | ||
| 53 | ]; | 58 | ]; |
| 54 | 59 | ||
| 55 | try { | 60 | try { |
| 56 | - $res = HttpUtils::get($api_url, $params); | 61 | +// $res = HttpUtils::get($api_url, $params); |
| 62 | + $client = new \GuzzleHttp\Client(); | ||
| 63 | + $res = $client->request('GET', $api_url .'?'. http_build_query($params), [ | ||
| 64 | + 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号 | ||
| 65 | + ])->getBody()->getContents(); | ||
| 57 | $res = Arr::s2a($res); | 66 | $res = Arr::s2a($res); |
| 58 | } catch (\Exception | GuzzleException $e) { | 67 | } catch (\Exception | GuzzleException $e) { |
| 59 | errorLog('渠道信息', $params, $e); | 68 | errorLog('渠道信息', $params, $e); |
-
请 注册 或 登录 后发表评论