From af316b799b41b4c5e4ed18d376577eaecf5f1471 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Fri, 25 Oct 2019 15:29:10 +0800 Subject: [PATCH] add clear --- qq/Account.php | 8 ++++++-- qq/QqSDK.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/qq/Account.php b/qq/Account.php index 2717903..f40a24f 100644 --- a/qq/Account.php +++ b/qq/Account.php @@ -48,6 +48,10 @@ class Account extends Miniprogarampage $param['js_code'] = $code; $param['grant_type'] = 'authorization_code'; + if (empty($code)) { + return new Result(['code' => 404, 'message' => '临时登录凭证不能为空.']); + } + $this->request->setHost('api.q.qq.com'); $this->request->setMethod(WxClient::GET); $this->request->addHeader('Content-Type', 'text/xml'); @@ -64,8 +68,8 @@ class Account extends Miniprogarampage { $query = [ 'access_token' => $this->getAccessToken(), - 'openid' => $openid, - 'lang' => 'zh_CN' + 'openid' => $openid, + 'lang' => 'zh_CN' ]; $this->request->setMethod(WxClient::GET); diff --git a/qq/QqSDK.php b/qq/QqSDK.php index 598065d..323e916 100644 --- a/qq/QqSDK.php +++ b/qq/QqSDK.php @@ -106,7 +106,7 @@ class QqSDK /** - * @return WxClient + * @return Token */ public function getAccessToken() {