jhl*_*sin 1 javascript sqlite bcrypt
我正在进行"注册"页面并且遇到sqlite问题.
我正在使用express,bcrypt-nodejs,bookself.js用于sqlite.收到错误说数据库已锁定.对此有何解决方法?赞赏.下面是该部分的代码.
app.post('/signup', function(req, res){
var username = req.body.username;
var password = req.body.password;
bcrypt.hash(password, null, null, function(err, hash){
new User({'username': username, 'password': hash})
.save()
.then(function(){
console.log('Successfully added a user');
})
.catch(function(err){
throw err;
});
});
res.render('login');
});
Run Code Online (Sandbox Code Playgroud)
问题是您在编程时与SQLite交互时,其他编辑器或SQLite客户端打开了".sqlite"文件.
在运行/测试代码之前,请确保没有任何其他应用程序打开/使用.sqlite文件.
| 归档时间: |
|
| 查看次数: |
3199 次 |
| 最近记录: |