【问题标题】:accountsGoogle publish profile picture帐户 Google 发布个人资料图片
【发布时间】:2017-06-15 17:39:01
【问题描述】:

在 Meteor 中,我使用的是 accountsGoogle 包。我正在尝试在我的网站上使用 Google 个人资料图片,但一旦删除 autopublish 包,我需要发布和订阅用户集合的 google 部分。我该怎么做呢?

Meteor.publish('users', function(){
    return Meteor.user.services.google.find({});
});

【问题讨论】:

    标签: meteor


    【解决方案1】:

    您可以使用从客户端获取用户文档

    Meteor.user()
    

    或者如果你真的想使用出版物

    Meteor.publish('users', function () {
        return Meteor.users.find(this.userId);
    })
    

    【讨论】:

    • Meteor.user() 不会返回用户集合的 services.google 部分,除非安装了自动发布功能。
    • 在我的应用程序上自动发布被删除,Meteor.user() 返回整个文档
    猜你喜欢
    • 1970-01-01
    • 2018-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多