...
|
...
|
@@ -38,10 +38,23 @@ const article = { |
|
|
});
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 管理员登录
|
|
|
* @param req
|
|
|
* @param res
|
|
|
*/
|
|
|
login(req, res) {
|
|
|
const userName = req.body.userName || '';
|
|
|
const password = req.body.password || '';
|
|
|
|
|
|
// TODO 管理员暂时写死
|
|
|
if (userName !== 'admin' || password !== 'yap@admin') {
|
|
|
return res.json({
|
|
|
code: 400,
|
|
|
message: '请检查账号和密码'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (!userName || !password) {
|
|
|
return res.json({
|
|
|
code: 400,
|
...
|
...
|
|