Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Meteor.loginWithPassword时出错_Meteor - Fatal编程技术网

使用Meteor.loginWithPassword时出错

使用Meteor.loginWithPassword时出错,meteor,Meteor,我在我的网站上使用“meteor.loginWithPassword”登录,但事实上我总是会收到错误:“Match failed”。 我不知道为什么? 我的数据库中有我正在测试的用户。我在某个地方读到,这是因为其中一个字段是空的,但这不是原因。 我不知道该查什么 Template.login.events({ 'submit form': function(event){ event.preventDefault(); var username = $('[name=usern

我在我的网站上使用“meteor.loginWithPassword”登录,但事实上我总是会收到错误:“Match failed”。 我不知道为什么? 我的数据库中有我正在测试的用户。我在某个地方读到,这是因为其中一个字段是空的,但这不是原因。 我不知道该查什么

Template.login.events({
'submit form': function(event){
    event.preventDefault();

    var username = $('[name=username]').val();
    var password = $('[name=password]').val();

    Meteor.loginWithPassword(username, password, function(error){
        console.log(error);
    });
}
}))

如果您在调用
loginWithPassword
之前
console.log(用户名、密码)
,是否会得到两个非空字符串?如果没有,则可能是jquery选择器不正确。如果在调用
loginWithPassword
之前调用
console.log(用户名、密码)
,是否会得到两个非空字符串?如果没有,可能是jquery选择器不正确。