Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.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
Node.js 在登录应用程序中使用服务但不工作?_Node.js_Angular_Mongodb_Express - Fatal编程技术网

Node.js 在登录应用程序中使用服务但不工作?

Node.js 在登录应用程序中使用服务但不工作?,node.js,angular,mongodb,express,Node.js,Angular,Mongodb,Express,我在这方面有问题。这是我的全部代码 exports.create = async (model) => { count({email:req.body.user},function(result){ if(result < 0){ res.json("The email already exist") } else{ model.password = await

我在这方面有问题。这是我的全部代码

    exports.create = async (model) => {
       count({email:req.body.user},function(result){
       if(result < 0){
           res.json("The email already exist")
       }
       else{
        model.password = await bcrypt.hash(model.password, 10)
        let entity = new User({})
        await set(entity, model)
        await entity.save()
        return entity
       }
   })
exports.create=async(model)=>{
计数({email:req.body.user},函数(结果){
如果(结果<0){
res.json(“电子邮件已经存在”)
}
否则{
model.password=等待bcrypt.hash(model.password,10)
让实体=新用户({})
等待集(实体、模型)
等待实体。保存()
返回实体
}
})

任何人都可以告诉我我的错误是什么吗

考虑添加所有错误日志和您面临的问题。添加有关您尝试执行的操作的详细信息什么是错误显示错误日志