From be2cb4ae27accc85e974e91d031480d0afd10052 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Fri, 24 May 2019 16:05:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=8E=88=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/plugins/weixinwebauthorization/index/Auth.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/plugins/weixinwebauthorization/index/Auth.php b/application/plugins/weixinwebauthorization/index/Auth.php index ae45ad36a..fa0fdf527 100644 --- a/application/plugins/weixinwebauthorization/index/Auth.php +++ b/application/plugins/weixinwebauthorization/index/Auth.php @@ -49,7 +49,7 @@ class Auth extends Controller $auth_type = (isset($ret['data']['auth_type']) && $ret['data']['auth_type'] == 1) ? 'snsapi_userinfo' : 'snsapi_base'; // 授权code - $url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='.$ret['data']['appid'].'&redirect_uri='.$redirect_uri.'&response_type=code&scope='.$auth_type.'&state=login#wechat_redirect'; + $url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='.$ret['data']['appid'].'&redirect_uri='.$redirect_uri.'&response_type=cossde&scope='.$auth_type.'&state=login#wechat_redirect'; return redirect($url); } else { $this->assign('msg', $ret['msg']); @@ -67,6 +67,12 @@ class Auth extends Controller */ public function callback($params = []) { + // 参数校验 + if(empty($params['code'])) + { + $this->assign('msg', '授权code为空'); + return $this->fetch('public/tips_error'); + } echo '
';
         print_r($params);