...
|
...
|
@@ -538,13 +538,19 @@ function prePasswordLoginWithValidate() { |
|
|
var defer = $.Deferred(); // eslint-disable-line
|
|
|
|
|
|
if (account === '') {
|
|
|
$accountTip.removeClass('hide').children('em').text('请输入账户名');
|
|
|
showAccountTip('请输入账户名');
|
|
|
defer.reject();
|
|
|
}
|
|
|
|
|
|
if (password === '') {
|
|
|
showPasswordTip('请输入密码');
|
|
|
defer.reject();
|
|
|
}
|
|
|
|
|
|
if (account === '' && password === '') {
|
|
|
// 账户名和密码都为空的情况下点击登陆,只在账户输入框后显示错误提示
|
|
|
$accountTip.addClass('both-error').removeClass('hide').children('em').text('请输入账户名和密码');
|
|
|
showAccountTip('请输入账户名和密码');
|
|
|
|
|
|
$passwordTip.addClass('hide');
|
|
|
$passwordInput.addClass('error');
|
|
|
defer.reject();
|
...
|
...
|
@@ -563,16 +569,21 @@ function preSmsLoginWithValidate() { |
|
|
var defer = $.Deferred(); // eslint-disable-line
|
|
|
|
|
|
if (account === '') {
|
|
|
$accountTip.removeClass('hide').children('em').text('请输入账户名');
|
|
|
showAccountTip('请输入手机号');
|
|
|
defer.reject();
|
|
|
}
|
|
|
|
|
|
if (password === '') {
|
|
|
showCaptchaSmsTip('请输入短信验证码');
|
|
|
defer.reject();
|
|
|
}
|
|
|
|
|
|
if (password === '' && account === '') {
|
|
|
// 账户名和密码都为空的情况下点击登陆,只在账户输入框后显示错误提示
|
|
|
$accountTip.addClass('both-error').removeClass('hide').children('em').text('请输入验证码');
|
|
|
showAccountTip('请输入手机号和短信验证码');
|
|
|
|
|
|
$passwordTip.addClass('hide');
|
|
|
$passwordInput.addClass('error');
|
|
|
$captchaSmsTip.addClass('hide');
|
|
|
$captchaSmsInput.addClass('error');
|
|
|
defer.reject();
|
|
|
}
|
|
|
|
...
|
...
|
@@ -650,7 +661,7 @@ function login() { |
|
|
}
|
|
|
});
|
|
|
}).then(function(res) {
|
|
|
console.log(res);
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
if (res.data) {
|
|
|
location.href = res.data.session;
|
...
|
...
|
@@ -710,7 +721,7 @@ $(document).on('click', function(e) { |
|
|
|
|
|
// 邮箱自动完成后失去焦点:1. 本地验证格式;2.服务器检查用户是否注册;3.检查验证用户次数
|
|
|
mailAc($accountInput, function() {
|
|
|
return validateAccountPasswordLocal().then(function() {
|
|
|
return currentLogin.validateAccountLocal().then(function() {
|
|
|
return currentLogin.validateAccountAsync().always(checkUserAuthCountAsync);
|
|
|
});
|
|
|
});
|
...
|
...
|
|