第一步:控制器中需要转向
“https://open.weixin.qq.com/connect/oauth2/authorize?appid={$this->app_id}&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_userinfo&state={$state}#wechat_redirect”后的页面获取code值;第二步:获取到code值后再转向
https://api.weixin.qq.com/sns/oauth2/access_token?appid={$this->app_id}&secret={$this->app_secret}&code={$code}&grant_type=authorization_code获取这个页面的json,注意,$code就是$_GET到的code值!尝试用了header("Location:.........");可以走通第一步,用两个header的话就获取不了code值了!
怎么操作获取到最终的json值!!!
最佳答案