windows上用bcrypt-nodejs 替代 bcrypt
相对应的代码为
var bcrypt = require('bcrypt-nodejs')
...
bcrypt.hash(user.password, null, null, function (err, hash){
if (err) {
return next(err)
}
user.password = hash
next()
})相对应的代码为
var bcrypt = require('bcrypt-nodejs')
...
bcrypt.hash(user.password, null, null, function (err, hash){
if (err) {
return next(err)
}
user.password = hash
next()
})2015-02-01
举报