Authored by htoooth

add fix

@@ -35,7 +35,16 @@ router.post('/passport/login/qrcode/refresh', login.local.qrcode.refresh); @@ -35,7 +35,16 @@ router.post('/passport/login/qrcode/refresh', login.local.qrcode.refresh);
35 router.post('/passport/login/qrcode/check', login.local.qrcode.check); // 验证二维码的状态 35 router.post('/passport/login/qrcode/check', login.local.qrcode.check); // 验证二维码的状态
36 36
37 router.get('/passport/login', login.common.beforeLogin, login.local.loginPage); 37 router.get('/passport/login', login.common.beforeLogin, login.local.loginPage);
38 -router.post('/passport/login/auth', captcha.requiredAPI, login.local.login); 38 +router.post('/passport/login/auth',
  39 + (req, res, next) => {
  40 + if (req.body.loginType === 'password') {
  41 + return captcha.requiredAPI(req, res, next);
  42 + } else {
  43 + return next();
  44 + }
  45 + },
  46 + login.local.login
  47 +);
39 router.get('/passport/logout', login.local.logout); 48 router.get('/passport/logout', login.local.logout);
40 49
41 // 微信登录 50 // 微信登录
@@ -250,6 +250,8 @@ var tpl = function(text) { @@ -250,6 +250,8 @@ var tpl = function(text) {
250 ].join(''); 250 ].join('');
251 }; 251 };
252 252
  253 +require('../../common/promise');
  254 +
253 // 切换登录方式 255 // 切换登录方式
254 accountChangeEvent.add(function(type) { 256 accountChangeEvent.add(function(type) {
255 currentLogin = AccountLoginData[type]; 257 currentLogin = AccountLoginData[type];
@@ -279,9 +281,9 @@ accountChangeEvent.add(function(type) { @@ -279,9 +281,9 @@ accountChangeEvent.add(function(type) {
279 if ($showCaptchaImg) { 281 if ($showCaptchaImg) {
280 $captchaImgWrapper.removeClass('hide'); 282 $captchaImgWrapper.removeClass('hide');
281 283
282 - setTimeout(function() { 284 + $.sleep(500).then(function() {
283 captchaImg.refresh(); 285 captchaImg.refresh();
284 - }, 500); 286 + });
285 } 287 }
286 } 288 }
287 289
@@ -651,7 +653,9 @@ function validateSmsCaptchaImg() { @@ -651,7 +653,9 @@ function validateSmsCaptchaImg() {
651 } 653 }
652 654
653 function refreshSmsCaptchaImg() { 655 function refreshSmsCaptchaImg() {
654 - smsCaptchaImg.refresh(); 656 + $.sleep(1000).then(function() {
  657 + smsCaptchaImg.refresh();
  658 + });
655 } 659 }
656 660
657 /** ************************************************************************/ 661 /** ************************************************************************/