Authored by 李奇

管理员账号设定

@@ -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,
@@ -38,8 +38,6 @@ @@ -38,8 +38,6 @@
38 </tbody> 38 </tbody>
39 </table> 39 </table>
40 </div> 40 </div>
41 -  
42 -  
43 </div> 41 </div>
44 </div> 42 </div>
45 </div> 43 </div>