Showing
1 changed file
with
2 additions
and
2 deletions
@@ -217,10 +217,10 @@ const local = { | @@ -217,10 +217,10 @@ const local = { | ||
217 | passport.authenticate('local', (err, user) => { | 217 | passport.authenticate('local', (err, user) => { |
218 | let loginSession = req.session.login; | 218 | let loginSession = req.session.login; |
219 | 219 | ||
220 | - if (err) { | 220 | + if (err || !user) { |
221 | let obj = { | 221 | let obj = { |
222 | code: 400, | 222 | code: 400, |
223 | - message: err, | 223 | + message: err || '登录出错请重试', |
224 | data: '' | 224 | data: '' |
225 | }; | 225 | }; |
226 | 226 |
-
Please register or login to post a comment