【发布时间】:2015-07-24 10:14:39
【问题描述】:
我在 Meteor 中有一个从 Meteor-admin 存根创建的基本项目:(https://github.com/yogiben/meteor-admin)
我需要为所有用户显示头像,而不仅仅是当前用户。 为了显示用户的头像,我需要他的电子邮件地址。 (我正在使用实用程序:头像https://atmospherejs.com/utilities/avatar)
问题:我应该对项目进行哪些调整才能访问其他用户的数据?
这可能与发布用户有关。
目前我有:
{{> avatar user=getAuthor shape="circle" size="small"}}
getAuthor: ->
console.log 'Owner:'
console.log @owner
user = Meteor.users.findOne(@owner)
console.log user
user
这会为所有用户正确打印Owner: @owner (id),但user 对象仅为当前用户填充。
我在服务器端也有这段代码:
Meteor.publishComposite 'user', ->
find: ->
Meteor.users.find _id: @userId
children: [
find: (user) ->
_id = user.profile?.picture or null
ProfilePictures.find _id: _id
]
(儿童/个人资料图片无关)
我认为account-base 图书馆关闭了发布功能还是什么?感谢您的帮助!
额外问题:我只想访问有关用户的一些信息(电子邮件地址)。
【问题讨论】:
标签: meteor user-accounts