Authored by htoooth

Merge branch 'feature/qr-code-new' into release/5.2

@@ -952,35 +952,23 @@ function loginAsync() { @@ -952,35 +952,23 @@ function loginAsync() {
952 } 952 }
953 }); 953 });
954 }).then(function(res) { 954 }).then(function(res) {
955 -  
956 if (res.code === 200) { 955 if (res.code === 200) {
957 if (res.data) { 956 if (res.data) {
958 location.href = res.data.session; 957 location.href = res.data.session;
959 } 958 }
960 } else { 959 } else {
961 - if (res.data.errorType === 'captcha') {  
962 - $captchaImgTip.removeClass('hide')  
963 - .children('em')  
964 - .html(res.message);  
965 -  
966 - $captchaImgInput.addClass('error').val(''); 960 + if (currentLogin.type() === 'password') {
  961 + showPasswordTip(res.message);
  962 + $passwordInput.addClass('error').val('');
967 963
968 - } else {  
969 - if (currentLogin.type() === 'password') {  
970 - showPasswordTip(res.message);  
971 - $passwordInput.addClass('error').val('');  
972 -  
973 - } else if (currentLogin.type() === 'sms') {  
974 - showCaptchaSmsTip('短信验证码错误');  
975 - $captchaSmsInput.addClass('error').val('');  
976 - } else if (currentLogin.type() === 'qrcode') {  
977 - showQrCodeFailTip(QR_CODE_ERR.fail); 964 + if (res.data && res.data.needCaptcha) {
  965 + showCaptchaImgPic(); // eslint-disable-line
978 } 966 }
979 - }  
980 -  
981 - // 验证错误次数  
982 - if (res.data && res.data.needCaptcha) {  
983 - showCaptchaImgPic(); // eslint-disable-line 967 + } else if (currentLogin.type() === 'sms') {
  968 + showCaptchaSmsTip('短信验证码错误');
  969 + $captchaSmsInput.addClass('error').val('');
  970 + } else if (currentLogin.type() === 'qrcode') {
  971 + showQrCodeFailTip(QR_CODE_ERR.fail);
984 } 972 }
985 } 973 }
986 }); 974 });