diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index 84598fa..c6ec9c6 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -8,7 +8,7 @@ use Swoole\Coroutine\System; class HttpClient { - private $host = 'api.weixin.qq.com'; + private $host = ''; private $header = []; @@ -317,7 +317,7 @@ class HttpClient */ private function parseUrlHost($url) { - if (strpos($this->host, $url) === false) { + if (!empty($this->host) && strpos($this->host, $url) === false) { $url = rtrim($this->host, '/') . '/' . ltrim($url, '/'); } if (!$this->isHttp($url) && !$this->isHttps($url)) { @@ -339,7 +339,6 @@ class HttpClient { $url = $this->replaceHost($url); $explode = explode('/', $url); - var_dump($explode); $first = array_shift($explode); if (strpos($first, ':') !== false) { [$first, $this->port] = explode(':', $first); @@ -348,8 +347,6 @@ class HttpClient } } $url = '/' . implode('/', $explode); - - var_dump($first, $url, $explode); return [$first, $url]; }