Skip to content

Commit

Permalink
Merge pull request ant-design#184 from zlotus/remote_dev
Browse files Browse the repository at this point in the history
fix mock error caused by invalid username
  • Loading branch information
zuiidea authored Apr 15, 2017
2 parents db8b283 + 69fbb47 commit 3d03fa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mock/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() }), {
Expand Down

0 comments on commit 3d03fa0

Please sign in to comment.