我在我的应用程序和用户页面中运行了Facebook登录,以显示最重要的用户详细信息.当我使用密码登录时,请使用以下代码:
user: function(){
return Meteor.user().username
},
Run Code Online (Sandbox Code Playgroud)
有:
<h1>Welcome {{user}}</h1>
Run Code Online (Sandbox Code Playgroud)
返回用户名.当我使用Facebook登录登录时,用户名为空.
如何通过Facebook登录时访问当前用户的用户名?
谢谢
感谢@ user3374348的评论设法找到它
Facebook用户名可在profile.name中找到.所以
return Meteor.user().username || Meteor.user().profile.name
Run Code Online (Sandbox Code Playgroud)
返回用户名(如果可用)或Facebook名称.
谢谢您的帮助
| 归档时间: |
|
| 查看次数: |
1334 次 |
| 最近记录: |