|
|
@ -26,7 +26,8 @@ if ($code != null){ |
|
|
} // code已经成功获取到 |
|
|
} // code已经成功获取到 |
|
|
|
|
|
|
|
|
$url = 'https://api.weixin.qq.com/sns/oauth2/access_token?appid=' . $app_id . '&secret=' . $app_secret . '&code=' . $code . '&grant_type=authorization_code'; |
|
|
$url = 'https://api.weixin.qq.com/sns/oauth2/access_token?appid=' . $app_id . '&secret=' . $app_secret . '&code=' . $code . '&grant_type=authorization_code'; |
|
|
// $response = file_get_contents($url); |
|
|
$response = file_get_contents($url); |
|
|
|
|
|
echo $response; |
|
|
// $data = json_decode($response, true); |
|
|
// $data = json_decode($response, true); |
|
|
// if (!$data || !isset($data['access_token']) || !isset($data['openid'])) { |
|
|
// if (!$data || !isset($data['access_token']) || !isset($data['openid'])) { |
|
|
// // 授权失败 |
|
|
// // 授权失败 |
|
|
|