我正在尝试创建一个简单的评论表单,访问者可以在其中创建评论。评论将是:comment = { name: "string", body: "string", image: "string" }
我希望任何人都能够创建评论并上传图片而无需创建用户帐户。动机是这是对一位去世的朋友的纪念。访问者应该能够上传记忆的图片,而无需创建帐户。
当我尝试将文件上传到 AWS 时,我收到以下错误:
TypeError: Meteor.userId is not a function
userId: Meteor.userId() // 70
我在该行设置了一个断点,发现第 70 行Meteor.userId()
未定义。
validate: function(file) { // 68
var context = { // 69
userId: Meteor.userId() // 70
};
// 71
try { // 72
var validators = Slingshot.Validators, // 73
restrictions = Slingshot.getRestrictions(directive); // 74
// 75
validators.checkAll(context, file, metaData, restrictions) && null; // 76
} catch(error) { // 77
return error; // 78
} // 79
},
有什么方法可以禁用 Meteor.userId()slingshot
通过 API 干净地上传文件的需要?或者只是让人们注册并登录,以便 Meteor.userId() 可以使用?