Commit a3653fae authored by ganjingcun's avatar ganjingcun

bug fix

parent 2bbd2acd
......@@ -31,8 +31,13 @@ app.all('*', function (req, res, next) {
// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
// app.use(bodyParser.json());
// app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json({ limit: "50mb" }));
app.use(bodyParser.urlencoded({ limit: "50mb", extended: true, parameterLimit: 50000 }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use(express.static(path.join(__dirname, 'upload')));
......
......@@ -1368,6 +1368,8 @@ router.post('/deckinfo', function (req, res) {
}
var contentStr = JSON.stringify(content);
contentStr = contentStr.replace(/'/g, "''")
if (!name) {
return res.status(404).send('deck name is required!')
......@@ -1411,6 +1413,7 @@ router.post('/deckinfo', function (req, res) {
done();
var response = {};
console.log(err)
if (err) {
response.code = 500;
} else {
......@@ -1853,12 +1856,12 @@ router.post('/adClick', function (req, res) {
let id = req.body.id;
var response = {};
if(!id){
if (!id) {
response.code = 500;
res.json(response);
return
}
var sql = `update ads set
clk = clk + 1
where id = '${id}'`;
......@@ -1892,7 +1895,7 @@ router.post('/adImpl', function (req, res) {
let id = req.body.id;
var response = {};
if(!id){
if (!id) {
response.code = 500;
res.json(response);
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment