add clear
This commit is contained in:
@@ -282,7 +282,7 @@ class HttpClient
|
||||
{
|
||||
$data = $this->paramEncode($data);
|
||||
if ($this->use_swoole) {
|
||||
return $this->coroutine($this->host, $this->matchHost($url), $data);
|
||||
return $this->coroutine($this->matchHost($url), $data);
|
||||
} else {
|
||||
return $this->useCurl($url, $data);
|
||||
}
|
||||
@@ -452,16 +452,15 @@ class HttpClient
|
||||
|
||||
|
||||
/**
|
||||
* @param $ip
|
||||
* @param $url
|
||||
* @param array $data
|
||||
* @return array|mixed|Result
|
||||
* @throws \Exception
|
||||
* 使用swoole协程方式请求
|
||||
*/
|
||||
private function coroutine($ip, $url, $data = [])
|
||||
private function coroutine($url, $data = [])
|
||||
{
|
||||
$client = $this->generate_client($ip, $url, $data);
|
||||
$client = $this->generate_client($this->host, $url, $data);
|
||||
if ($client->statusCode < 0) {
|
||||
throw new \Exception($client->errMsg);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class SecCheck extends SmallProgram
|
||||
// $this->request->setHost('api.q.qq.com');
|
||||
$this->request->setIsSSL(true);
|
||||
|
||||
$url = 'https://api.q.qq.com'.$this->_msgUrl . $this->config->getAccessToken();
|
||||
$url = 'https://api.q.qq.com/' . ltrim($this->_msgUrl, '/') . $this->config->getAccessToken();
|
||||
return $this->request->post($url, json_encode([
|
||||
'appid' => $this->config->getAppid(),
|
||||
'content' => $content
|
||||
|
||||
Reference in New Issue
Block a user