下面的代码在名称和电子邮件上给了我一个“未定义”。但是用户登录是因为我确实有访问令牌和 UID?
function getToken(){
FB.login(function(response) {
if (response.authResponse) {
var access_token = response.authResponse.accessToken;
var uid = response.authResponse.userID;
document.getElementById('accessToken').value=access_token;
document.getElementById('uid').value=uid;
FB.api('/me', function(response) {
console.log('Good to see you, ' + response.name + '.' +response.email);
});
document.forms['token'].submit();
} else {
return false;
}
}, {scope:'email,user_likes,friends_likes'});
}
当我将 fb.api 的完整响应输出到控制台时,我得到
[11:46:10.369] ({error:"load-error: unknown"})