Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用本地护照的示例,我可以登录工作。没有关于如何注册用户的文档。
我想给用户一个“电子邮件”和“密码”字段,他们可以用来注册该网站。我怎样才能做到这一点?有什么理由没有记录吗?这真的很明显吗?
实际上,这已经解释了太多次了..如果您使用的表模式就是User,那么在数据库中创建一条新记录。
User
var newUser = new User(); newUser({username: req.body.username , password : req.body.password}); newUser.save(function(doc , error){ if(error) console.log('user is not saved'); res.send(200); })