Showing
2 changed files
with
13 additions
and
2 deletions
@@ -38,10 +38,23 @@ const article = { | @@ -38,10 +38,23 @@ const article = { | ||
38 | }); | 38 | }); |
39 | }, | 39 | }, |
40 | 40 | ||
41 | + /** | ||
42 | + * 管理员登录 | ||
43 | + * @param req | ||
44 | + * @param res | ||
45 | + */ | ||
41 | login(req, res) { | 46 | login(req, res) { |
42 | const userName = req.body.userName || ''; | 47 | const userName = req.body.userName || ''; |
43 | const password = req.body.password || ''; | 48 | const password = req.body.password || ''; |
44 | 49 | ||
50 | + // TODO 管理员暂时写死 | ||
51 | + if (userName !== 'admin' || password !== 'yap@admin') { | ||
52 | + return res.json({ | ||
53 | + code: 400, | ||
54 | + message: '请检查账号和密码' | ||
55 | + }); | ||
56 | + } | ||
57 | + | ||
45 | if (!userName || !password) { | 58 | if (!userName || !password) { |
46 | return res.json({ | 59 | return res.json({ |
47 | code: 400, | 60 | code: 400, |
-
Please register or login to post a comment