From 7ed51596da6c4309c1ea0fce66d9f654c21d7927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 3 Apr 2020 18:41:06 +0800 Subject: [PATCH] add clear --- wchat/common/HttpClient.php | 7 +++---- wchat/qq/SecCheck.php | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index a74a68f..0f59a0d 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -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); } diff --git a/wchat/qq/SecCheck.php b/wchat/qq/SecCheck.php index 27d1cbd..d9e9383 100644 --- a/wchat/qq/SecCheck.php +++ b/wchat/qq/SecCheck.php @@ -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