router.get("/", function (req, res){
pool.getConnection(function (err, connection) {
connection.query('SELECT * FROM pro', function (err, rows) {
res.render("index",{"rows" : rows});
});
});
})
// delete
router.post('/delete', function (req, res){
pool.getConnection(function (err, connection) {
connection.query("DELETE FROM pro WHERE id = "+req.body.del, function (err, rows) {
connection.release();
res.redirect(301,"/");
});
});
});
res.redirect(301, "/")
之后Response的代码的确已经更新;但是页面没有重新渲染。问什么啊?