From 663bf23ebd44fde17d37c78d0065ffcf4adca3e9 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Fri, 19 Jul 2019 19:11:12 +0800 Subject: [PATCH] add clear --- wx/Account.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/wx/Account.php b/wx/Account.php index fdf9549..51e6dc4 100644 --- a/wx/Account.php +++ b/wx/Account.php @@ -12,6 +12,7 @@ class Account extends Miniprogarampage 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 $publicInfo = 'https://api.weixin.qq.com/cgi-bin/user/info?'; private $getwxacodeunlimit = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token='; private $savePath = __DIR__ . '/../../../'; @@ -48,6 +49,24 @@ class Account extends Miniprogarampage return $this->request->get('/sns/jscode2session', $param); } + /** + * @param $openid + * @return array|mixed|Result + * @throws \Exception + */ + public function getPublicUserInfo($openid) + { + $query = [ + 'access_token' => $this->getAccessToken(), + 'openid' => $openid, + 'lang' => 'zh_CN' + ]; + + $this->request->setMethod(WxClient::GET); + $this->request->setIsSSL(true); + return $this->request->get($this->publicInfo, $query); + } + /** * @param $encryptedData