express里面的路由劫持
劫持
var myLogger = function (req, res, next) {
if(['/user/add','/user/delete','/user/update'].includes(req.path)){
if(!req.cookies['token']) {
res.status(403).json({code: 403, message: 'token无效!'});
} else {
next();
}
} else {
next();
}
};
app.use(myLogger);
漫思