- 🔭 I’m currently working in changsha...
- 🌱 I’m currently learning webgl ...
- 📫 How to reach me: [email protected]...p
Languages and Tools:
🔥Blog management site
Languages and Tools:
api/index.js line 87
需要休正一下 去掉多余的 “function (err, rows) {,”
config文件中,我也是正确的配置了user,password字段,但依然提示数据库连接失败。请教一下这是为啥
怎么部署到线上啊,大大
如题
npm run api 失败
npm run sqlInit
password 需要用引号引起来,不然sql报错
app.post('/login', function (req, res) {
sql.query('select user from person where user="' + req.body.username + '" and password="' + req.body.password+'"', function (err, rows) {
if (err || rows.length == 0) {
console.log(err)
res.send({code: 0})
}else {
res.send({code: 1})
}
})
})
代码中很多axios方法已经不兼容了,建议参考最新文档进行修改
api/index.js 87行
原本是这样:
sql.query('select user from person where user="' + req.body.username + '" and password="' + req.body.password, function (err, rows) {
一直登陆失败
但是,改成这样:
sql.query('select user from person where user="' + req.body.username + '" and password="' + req.body.password+'"', function (err, rows) {
就可以登陆了
区别是:req.body.password后面少个双引号
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.