最新回答 / qq_运着篮球的挨踢侠客丶_0
hash(data, salt, progress, cb) data——[要求]被加密的数据。 salt——[要求]盐用于哈希密码。 progress——一个回调期间被称为哈希计算意味着进步 callback——[要求]——一个回调被解雇一旦数据已经加密。 error——第一个参数的回调详述任何错误。 result——第二个参数的回调提供加密的形式这里可以设置为 NULL
2016-07-19
最新回答 / 慕仙4324424
view-source:localhost:xxxx,你确定是这样查看的吗?app.set('view engine','jade');这个加了吗?
2016-06-01
最新回答 / 不赢
出现类似于Cannot read property 'username' of null 之类的空指针异常,一般都是对象为空值,鉴于你问题描述不够清楚,可能是:渲染本页面的时候post没有传递过来或者为空
2016-05-24
最赞回答 / 柏树4063064
UserSchema.pre('save',function(next){ var user = this; console.log('this is first'); //保存新数据 if(this.isNew){ this.meta.createAt = this.meta.updateAt =Date.now(); } else{ //更新数据 this.meta.updateAt = Date.now(); } bcrypt.genSalt(SALT_WORK_FACTOR,function...
2016-05-21
最赞回答 / Scarecrow_
bcrypt.compare(_password, user.password, function(err, isMatch) { if (err){ console.log(err); return cb(err) } //console.log(_password+user.password); //cb(null, isMatch) //上面代码出错,始终验证密码错误,自己修正如下 if(_password==user.passwo...
2016-05-13