php
access_token)) {
$access_token = $token->access_token;
$userinfo = json_decode(file_get_contents($userinfo_url . "?access_token=$access_token"));
if (isset($userinfo->email)) {
$email = $userinfo->email;
// 处理用户信息,例如创建新用户或登录现有用户
}
}
} else {
$params = array(
'response_type' => 'code',
'client_id' => $client_id,
'redirect_uri' => $redirect_uri,
'scope' => 'email'
);
header('Location: ' . $auth_url . '?' . http_build_query($params));
exit;
}
?>
顶一下
(0)
0%
踩一下
(0)
0%
- 相关评论
- 我要评论
-