【发布时间】:2021-07-08 11:33:19
【问题描述】:
这段代码有这个错误:
async function get(user) {
user = await Joi.validate(user, userSchemaGet, { abortEarly: false });
await User.findOne(
{_id: user._id},
(err, res) => {
if(err){
console.log("ERROR : ")
console.log(err)
} else {
console.log("res")
console.log(res);
if(bcrypt.hash(user.password, 10) === res.hashedPassword) {
return res;
}
}
});
}
我阅读了有关此主题的所有 stackoverflow,但没有任何反应。 ps : 昨天运行的很完美...
【问题讨论】: