diff --git a/src/mock/users.js b/src/mock/users.js index a2155b97a5..a12f2172f3 100644 --- a/src/mock/users.js +++ b/src/mock/users.js @@ -61,7 +61,7 @@ module.exports = { const { username, password } = req.body const user = adminUsers.filter((item) => item.username === username) - if (user && user[0].password === password) { + if (user[0] && user[0].password === password) { const now = new Date() now.setDate(now.getDate() + 1) res.cookie('token', JSON.stringify({ id: user[0].id, deadline: now.getTime() }), {