Showing
1 changed file
with
1 additions
and
11 deletions
@@ -22,19 +22,9 @@ module.exports = (req, res, next) => { | @@ -22,19 +22,9 @@ module.exports = (req, res, next) => { | ||
22 | } | 22 | } |
23 | 23 | ||
24 | if (!isAdmin) { | 24 | if (!isAdmin) { |
25 | - if (req.xhr) { | ||
26 | - return res.json({ | ||
27 | - code: 401, | ||
28 | - message: '抱歉,您没有管理员权限' | ||
29 | - }); | ||
30 | - } | ||
31 | - | ||
32 | - return res.render('error/403', { | ||
33 | - layout: false | ||
34 | - }); | 25 | + return res.redirect('/admin/login'); |
35 | } | 26 | } |
36 | 27 | ||
37 | req.isAdmin = true; | 28 | req.isAdmin = true; |
38 | - | ||
39 | next(); | 29 | next(); |
40 | }; | 30 | }; |
-
Please register or login to post a comment