add clear

This commit is contained in:
2020-11-13 15:54:35 +08:00
parent e3956048b2
commit c37a3995e9
2 changed files with 3 additions and 3 deletions
-1
View File
@@ -348,7 +348,6 @@ class HttpClient
$this->host = System::gethostbyname($this->host); $this->host = System::gethostbyname($this->host);
} }
var_dump($this->host);
if (!$this->checkIsIp($this->host) && !$this->isDomainName($this->host)) { if (!$this->checkIsIp($this->host) && !$this->isDomainName($this->host)) {
throw new Exception('Client Host error.'); throw new Exception('Client Host error.');
} }
+3 -2
View File
@@ -17,7 +17,6 @@ class Account extends SmallProgram
private $wxaqr = 'https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token='; private $wxaqr = 'https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=';
private $getwxacode = 'https://api.weixin.qq.com/wxa/getwxacode?access_token='; private $getwxacode = 'https://api.weixin.qq.com/wxa/getwxacode?access_token=';
private $publicInfo = 'https://api.weixin.qq.com/cgi-bin/user/info';
private $getwxacodeunlimit = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token='; private $getwxacodeunlimit = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=';
private $savePath = __DIR__ . '/../../Users/'; private $savePath = __DIR__ . '/../../Users/';
@@ -73,9 +72,11 @@ class Account extends SmallProgram
$this->request->setMethod(HttpClient::GET); $this->request->setMethod(HttpClient::GET);
$this->request->setIsSSL(true); $this->request->setIsSSL(true);
$this->request->setHost('api.weixin.qq.com');
$this->request->addHeader('Host', 'api.weixin.qq.com');
$this->request->setErrorField('errcode'); $this->request->setErrorField('errcode');
$this->request->setErrorMsgField('errmsg'); $this->request->setErrorMsgField('errmsg');
return $this->request->get($this->publicInfo, $query); return $this->request->get('user/info', $query);
} }