简体   繁体   English

流星:帐户密码

[英]Meteor: accounts-password

I'm using accounts-password but I can't locate the user collection. 我正在使用帐户密码,但是找不到用户集合。 Please help. 请帮忙。 在此处输入图片说明

注册后,我应该看到以下内容 相反,我一直在获取没有注册数据的空数组 Also, in which file can I find the code for the users collection? 另外,我可以在哪个文件中找到用户集合的代码? In an effort to use best practices, I have separated my code into isClient, isServer, and both but I don't see the code anyway. 为了使用最佳实践,我将代码分为isClient和isServer两者,但是我仍然看不到代码。

When I attempt to register a user in the browser I can't retrieve it using Meteor.users.find().fetch(); 当我尝试在浏览器中注册用户时,无法使用Meteor.users.find()。fetch()检索它。 in the console. 在控制台中。

Here's the my code: 这是我的代码:

Template.register.events({
    'submit form': function(event){
        event.preventDefault();
        var email = $('[name=email]').val();
        var password = $('[name=password]').val();
        Accounts.createUser({
            email: email,
            password: password
        });
        Router.go('home');
    }
});

When I attempt to register a user in the browser I can't retrieve user information using Meteor.users.find().fetch(); 当我尝试在浏览器中注册用户时,无法使用Meteor.users.find()。fetch()检索用户信息。 in the console. 在控制台中。 Registration form code: 注册表格代码:

<template name="register">
    <h2>Register</h2>
    <form class="register">
        <p>Email: <input type="email" name="email"></p>
        <p>Password: <input type="password" name="password"></p>
        <p><input type="submit" value="Register"></p>
    </form>
</template>
meteor create hello
cd hello
meteor

=> go to http://localhost:3000 =>转到http:// localhost:3000

Then the collection is just Meteor.users . 然后,该集合只是Meteor.users Try Meteor.users.find().fetch() in your console, you should get an empty Array : [] => it means it's all set up 在您的控制台中尝试Meteor.users.find().fetch() ,您应该获得一个空的Array: [] =>这意味着它们已经全部设置好了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM