【发布时间】:2017-04-22 22:14:12
【问题描述】:
我只是想通过特定电子邮件验证帐户是否存在,但我了解到 Accounts.findUserByEmail() 仅适用于服务器端。
似乎反复建议的方法是定义一个Meteor.method() 并在那里完成所有工作。不幸的是,我显然不知道自己在做什么,因为我遇到了其他人从未遇到过的错误。
component.js:
Meteor.call('confirm', email);
methods.js:
Meteor.methods({
'confirm': (email) => {
if (Accounts.findUserByEmail(email)) {
return;
}
}
});
我得到的只是这个错误:
Exception while simulating the effect of invoking 'confirm' TypeError: Accounts.findUserByEmail is not a function
我是否完全误解了 Meteor.methods + Meteor.call 的动态?它实际上不是服务器端的吗??
目前使用 Meteor 包,accounts-password@1.3.3
【问题讨论】:
标签: javascript meteor