【发布时间】:2017-07-12 09:03:10
【问题描述】:
我在 EJS 中打印错误时遇到问题,因为当我在 ejs 中使用时,我被定向到找不到错误 404。谁能告诉我它是怎么打印出来的?
req.checkBody('login', 'Login is required').notEmpty();
req.checkBody('password', 'Password is required').notEmpty();
var errors = req.validationErrors();
if (errors) {
console.log(errors)
res.render('index', {
errors: errors
});
【问题讨论】: