From 7def314478dba272da22787e82c99cfdc5f2175e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 13 Nov 2020 16:11:24 +0800 Subject: [PATCH] add clear --- wchat/wx/Account.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/wchat/wx/Account.php b/wchat/wx/Account.php index 64ccacb..d5f1a80 100644 --- a/wchat/wx/Account.php +++ b/wchat/wx/Account.php @@ -70,13 +70,16 @@ class Account extends SmallProgram 'lang' => 'zh_CN' ]; - $this->request->setMethod(HttpClient::GET); - $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->setErrorMsgField('errmsg'); - return $this->request->get('user/info', $query); + $client = HttpClient::NewRequest(); + $client->setAgent($this->config->getAgent()); + $client->setUseSwoole($this->config->isUsrSwoole()); + $client->setMethod(HttpClient::GET); + $client->setIsSSL(true); + $client->setHost('api.weixin.qq.com'); + $client->addHeader('Host', 'api.weixin.qq.com'); + $client->setErrorField('errcode'); + $client->setErrorMsgField('errmsg'); + return $client->get('user/info', $query); }