...
|
...
|
@@ -22,19 +22,9 @@ module.exports = (req, res, next) => { |
|
|
}
|
|
|
|
|
|
if (!isAdmin) {
|
|
|
if (req.xhr) {
|
|
|
return res.json({
|
|
|
code: 401,
|
|
|
message: '抱歉,您没有管理员权限'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return res.render('error/403', {
|
|
|
layout: false
|
|
|
});
|
|
|
return res.redirect('/admin/login');
|
|
|
}
|
|
|
|
|
|
req.isAdmin = true;
|
|
|
|
|
|
next();
|
|
|
}; |
...
|
...
|
|