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