Meteor Facebook 个人资料图片未显示
Meteor Facebook Profile Picture not Displaying
在第一次登录时,我有以下代码:
Accounts.onCreateUser(function(options,user){
if (typeof(user.services.facebook) != "undefined") {
user.services.facebook.picture = "http://graph.facebook.com/" + user.services.facebook.id + "/picture/?type=large";
}
return user;
});
这导致以下 URL 字符串
http://graph.facebook.com/[myfacebookid]/picture/?type=large
然而当它呈现 url 和 returns
<img scr="http://graph.facebook.com/[myfacebookid]/picture/?type=large" alt="My Name">
我看到的只是一张破损的图片。我怎样才能将其拉入以呈现 Facebook 个人资料图片?
我使用基于用户 Facebook ID 的辅助函数来抓取服务器上的图像。我注意到我的 url 有 /picture?你有/图片/?希望这有帮助。
userPicHelper: function() {
if (this.profile) {
var id = this.profile.facebookId;
var img = 'http://graph.facebook.com/' + id + '/picture?type=square&height=160&width=160';
return img;
}
},
之前不知道怎么漏掉了,是不是图片标签上的src属性居然写成了scr:
<img scr=
应该是...
<img src=
您使用的是 http 而不是 https。
所以:
"https://graph.facebook.com/" + id + "/picture/?type=large";
这是我的问题。
在第一次登录时,我有以下代码:
Accounts.onCreateUser(function(options,user){
if (typeof(user.services.facebook) != "undefined") {
user.services.facebook.picture = "http://graph.facebook.com/" + user.services.facebook.id + "/picture/?type=large";
}
return user;
});
这导致以下 URL 字符串
http://graph.facebook.com/[myfacebookid]/picture/?type=large
然而当它呈现 url 和 returns
<img scr="http://graph.facebook.com/[myfacebookid]/picture/?type=large" alt="My Name">
我看到的只是一张破损的图片。我怎样才能将其拉入以呈现 Facebook 个人资料图片?
我使用基于用户 Facebook ID 的辅助函数来抓取服务器上的图像。我注意到我的 url 有 /picture?你有/图片/?希望这有帮助。
userPicHelper: function() {
if (this.profile) {
var id = this.profile.facebookId;
var img = 'http://graph.facebook.com/' + id + '/picture?type=square&height=160&width=160';
return img;
}
},
之前不知道怎么漏掉了,是不是图片标签上的src属性居然写成了scr:
<img scr=
应该是...
<img src=
您使用的是 http 而不是 https。
所以:
"https://graph.facebook.com/" + id + "/picture/?type=large";
这是我的问题。