📅  最后修改于: 2022-03-11 15:03:50.890000             🧑  作者: Mango
app.use(function(req, res, next) {
if (req.user == null && req.path.indexOf('/admin') === 0)
{
res.redirect('/login');
}
next();
});