Authored by htoooth

add file

... ... @@ -317,6 +317,7 @@ mobileTipShowOnce.add(function() {
refreshSmsImgCallBack.add(function() {
$smsCaptchaImgPic.attr('src', CAPTCHA_IMG_URL + $.now());
$smsCaptchaImgInput.val('');
});
/** ************************************************************************/
... ... @@ -867,7 +868,6 @@ function validateWithPasswordMode() {
// 短信验证过程
function validateWithSmsMode() {
return validateAccount()
.then(validateSmsCaptchaImg)
.then(validateCaptchaSms);
}
... ... @@ -920,31 +920,31 @@ function preSmsLoginWithValidate() {
var defer = $.Deferred(); // eslint-disable-line
if (account === '') {
showAccountTip1('请输入手机号');
showAccountTip2('请输入手机号');
defer.reject();
return defer.reject().promise();
}
if (smsImg === '') {
showSmsCaptchaImgTip('请输入图形证码');
defer.reject();
return defer.reject().promise();
}
if (password === '') {
showCaptchaSmsTip('请输入短信验证码');
defer.reject();
return defer.reject().promise();
}
if (password === '' && account === '') {
// 账户名和密码都为空的情况下点击登陆,只在账户输入框后显示错误提示
showAccountTip1('请输入手机号和短信验证码');
showAccountTip2('请输入手机号和短信验证码');
$captchaSmsTip.addClass('hide');
$captchaSmsInput.addClass('error');
defer.reject();
return defer.reject().promise();
}
return defer.resolve().promise();
... ... @@ -965,7 +965,7 @@ function loginAsync() {
areaCode: getAreaCodeVal(),
account: currentLogin.getAccountVal(),
password: currentLogin.creditableToken(),
captcha: currentLogin.type() === 'password' ? getCaptchaImgVal() : getSmsCaptchaImgVal(),
captcha: currentLogin.type() === 'password' ? getCaptchaImgVal() : '',
isRemember: getRememberMeVal(),
loginType: currentLogin.type()
}
... ... @@ -1110,9 +1110,9 @@ $captchaSmsBtn.on('click', function() {
validateAccount()
.then(validateSmsCaptchaImg)
.then(function() {
disable60sSendSmsBtn();
return sendCaptchaSmsAsync();
});
disable60sSendSmsBtn();
return sendCaptchaSmsAsync();
});
});
// 记住登录状态
... ...