login-setpassword-error-log-handle
Showing
2 changed files
with
12 additions
and
3 deletions
@@ -285,7 +285,8 @@ const wechat = { | @@ -285,7 +285,8 @@ const wechat = { | ||
285 | doPassportCallback(openId, nickname, 'wechat', req, res).catch(next); | 285 | doPassportCallback(openId, nickname, 'wechat', req, res).catch(next); |
286 | })(req, res, next); | 286 | })(req, res, next); |
287 | } else { | 287 | } else { |
288 | - return next('Auth State Mismatch'); | 288 | + log.error('Auth State Mismatch:' + req.originalUrl); |
289 | + return res.redirect(loginPage); | ||
289 | } | 290 | } |
290 | } | 291 | } |
291 | }; | 292 | }; |
@@ -310,7 +311,8 @@ const sina = { | @@ -310,7 +311,8 @@ const sina = { | ||
310 | doPassportCallback(openId, nickname, 'sina', req, res).catch(next); | 311 | doPassportCallback(openId, nickname, 'sina', req, res).catch(next); |
311 | })(req, res, next); | 312 | })(req, res, next); |
312 | } else { | 313 | } else { |
313 | - return next('Auth State Mismatch'); | 314 | + log.error('Auth State Mismatch:' + req.originalUrl); |
315 | + return res.redirect(loginPage); | ||
314 | } | 316 | } |
315 | } | 317 | } |
316 | }; | 318 | }; |
@@ -336,7 +338,8 @@ const qq = { | @@ -336,7 +338,8 @@ const qq = { | ||
336 | doPassportCallback(openId, nickname, 'qq', req, res).catch(next); | 338 | doPassportCallback(openId, nickname, 'qq', req, res).catch(next); |
337 | })(req, res, next); | 339 | })(req, res, next); |
338 | } else { | 340 | } else { |
339 | - return next('Auth State Mismatch' + req.originalUrl); | 341 | + log.error('Auth State Mismatch:' + req.originalUrl); |
342 | + return res.redirect(loginPage); | ||
340 | } | 343 | } |
341 | } | 344 | } |
342 | }; | 345 | }; |
@@ -65,6 +65,7 @@ $('.pitch').on('click', function() { | @@ -65,6 +65,7 @@ $('.pitch').on('click', function() { | ||
65 | }); | 65 | }); |
66 | 66 | ||
67 | function setPassword() { | 67 | function setPassword() { |
68 | + $btnSure.addClass('disable'); | ||
68 | return $.ajax({ | 69 | return $.ajax({ |
69 | type: 'POST', | 70 | type: 'POST', |
70 | url: '/passport/reg/setpassword', | 71 | url: '/passport/reg/setpassword', |
@@ -96,8 +97,12 @@ function setPassword() { | @@ -96,8 +97,12 @@ function setPassword() { | ||
96 | location.href = res.href; | 97 | location.href = res.href; |
97 | }, 1500); | 98 | }, 1500); |
98 | } else { | 99 | } else { |
100 | + $btnSure.removeClass('disable'); | ||
99 | showErrTip(data.message); | 101 | showErrTip(data.message); |
100 | } | 102 | } |
103 | + }, | ||
104 | + error: function() { | ||
105 | + $btnSure.removeClass('disable'); | ||
101 | } | 106 | } |
102 | }); | 107 | }); |
103 | } | 108 | } |
@@ -114,6 +119,7 @@ $btnSure.on('touchstart', function() { | @@ -114,6 +119,7 @@ $btnSure.on('touchstart', function() { | ||
114 | } else { | 119 | } else { |
115 | if ($('.pitch').hasClass('select')) { | 120 | if ($('.pitch').hasClass('select')) { |
116 | setPassword(); | 121 | setPassword(); |
122 | + | ||
117 | } else { | 123 | } else { |
118 | $('.prompt').show(); | 124 | $('.prompt').show(); |
119 | 125 |
-
Please register or login to post a comment