bcrypt.compare比对失败,为什么呢
UserSchema.methods = {
comparePassword: function(_password, cb) {
console.log(_password+'==='+this.password);
bcrypt.compare(_password, this.password, function(err, isMatch) {
if (err) return cb(err)
console.log(isMatch)
cb(null, isMatch)
})
}
}明明就相等啊,为什么老是返回flash,我用的是bcryptjs