save的时候已经加密了,可是在数据库查表的时候还是加密之前的?
app.post("/index/signin",function(req,res,next){
var _user ;
_user = new USER({
username:req.body.username,
password:req.body.password,
});
_user.save(function(err,fe){
console.log(_user.password)//$2a$10$xUZNtgSjgHlDjmQoCTDsQO.AdQ6woRUWYSO.zayGcmVeZw0UKJC8.
if(err){
res.send(err);
}
else{
res.send({"ret":"ok"})
}
});
});