Meteor.userId()在包中为null
我正在创建一个流星包。此软件包在Meteor.userId()在包中为null,meteor,package,account,Meteor,Package,Account,我正在创建一个流星包。此软件包在package.json中使用了accountbase 我在服务器端创建了如下方法: Meteor.methods({ hide: function(notification_id){ kahonNotification.hide(notification_id,Meteor.userId()) } }); 问题是Meteor.userId()始终为空 以下是configuration package.json文件: Pa
package.json
中使用了accountbase
我在服务器端创建了如下方法:
Meteor.methods({
hide: function(notification_id){
kahonNotification.hide(notification_id,Meteor.userId())
}
});
问题是Meteor.userId()始终为空
以下是configuration package.json文件:
Package.onUse(function(api) {
api.versionsFrom('1.0.5');
api.use(['standard-app-packages'], ['client','server']);
api.use('accounts-base', 'server');
// Allows the user of this package to choose their own Bootstrap
// implementation.
api.use(['twbs:bootstrap@3.3.1', 'nemo64:bootstrap@3.3.1_1'], 'client', {weak: true});
api.addFiles(['client/notifications.html','client/notifications.js'],'client');
api.addFiles(['server/main.js','server/publications.js'],'server');
api.addFiles('shared/collections.js',['server','client'])
api.imply(['templating'], 'client');
api.export('kahonNotification')
});
Package.onTest(function(api) {
api.use('tinytest');
api.use('kahon:notificationsefficient');
api.addFiles('notificationsefficient-tests.js');
});
我没有登录该网页。这就是解决方案。一旦问题得到回答,并且您完成了解决方案提交,问题就变得毫无价值。任何未来的读者都无法从中受益。请在此发布与您的问题相关的代码。已完成,谢谢