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