这段代码运行后,也不报错,也不输出,真的让人抓瞎呀,请教!
const query = require('./mysql.js');const Koa = require('koa');
const async = require('async');
const app = new Koa();
app.use(async (ctx, next) => {
ctx.execSql = query;
await next();
});
async (ctx) => {
try {
let result = await ctx.execSql(`select * from contact_user where phone = 1 and password = 1`);
if (result.length > 0) {
console.log('a');
} else {
console.log('b');
}
} catch (err) {
console.log('c');
}
}
也不报错,也不输出,真的让人抓瞎呀!!!