认证0级讲师
redirect之後就不要send了
router.post('/login',function(req,res){ var query = require('../modules/database'); query("select * from managers where ManagerID =10001",function(err,vals,fields){ if(req.body.password==="admin") { res.redirect('/home'); return; ///这里加个return } res.send('ID或密码错误!'); }); });
redirect之後就不要send了