我扫了二维码结果手机出现一个空白页?

public function getBaseInfo()

{

$app_id = 'wxe103b4f7bbaeb1c6'; //公众号appid

$redirect_uri = urlencode("http://whltest.applinzi.com/www/wechat/public/index.php/index/index/access_token_info");

$url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=".$app_id."&redirect_uri=".$redirect_uri."&response_type=code&scope=snsapi_userinfo &state=123#wechat_redirect";

header('Location:'.$url);exit;

}


public function access_token_info()

{

$app_id = 'wxe103b4f7bbaeb1c6';

$app_secret = '7212da94e0a385b08c5de46ffef61740';

$code = $GET['code'];

$url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=".$app_id."&secret=".$app_secret."&code=".$code."&grant_type=authorization_code";

$res = $this->http_curl($url);

var_dump($res);

$access_token = $res['access_token'];

$openid = $res['openid'];

$url = "https://api.weixin.qq.com/sns/userinfo?access_token=".$access_token."&openid=".$openid."&lang=zh_CN";

$res = $this->http_curl($url);

var_dump($res);

}


慕少336928
浏览 1968回答 0
0回答
打开App,查看更多内容
随时随地看视频慕课网APP