Authored by htoooth

add sms

... ... @@ -952,35 +952,23 @@ function loginAsync() {
}
});
}).then(function(res) {
if (res.code === 200) {
if (res.data) {
location.href = res.data.session;
}
} else {
if (res.data.errorType === 'captcha') {
$captchaImgTip.removeClass('hide')
.children('em')
.html(res.message);
$captchaImgInput.addClass('error').val('');
if (currentLogin.type() === 'password') {
showPasswordTip(res.message);
$passwordInput.addClass('error').val('');
} else {
if (currentLogin.type() === 'password') {
showPasswordTip(res.message);
$passwordInput.addClass('error').val('');
} else if (currentLogin.type() === 'sms') {
showCaptchaSmsTip('短信验证码错误');
$captchaSmsInput.addClass('error').val('');
} else if (currentLogin.type() === 'qrcode') {
showQrCodeFailTip(QR_CODE_ERR.fail);
if (res.data && res.data.needCaptcha) {
showCaptchaImgPic(); // eslint-disable-line
}
}
// 验证错误次数
if (res.data && res.data.needCaptcha) {
showCaptchaImgPic(); // eslint-disable-line
} else if (currentLogin.type() === 'sms') {
showCaptchaSmsTip('短信验证码错误');
$captchaSmsInput.addClass('error').val('');
} else if (currentLogin.type() === 'qrcode') {
showQrCodeFailTip(QR_CODE_ERR.fail);
}
}
});
... ...