...
|
...
|
@@ -31,6 +31,8 @@ var checkbox = { |
|
|
unchecked: ''
|
|
|
};
|
|
|
|
|
|
var authing = false;
|
|
|
|
|
|
var emailAcTime;
|
|
|
|
|
|
require('yoho.placeholder');
|
...
|
...
|
@@ -46,7 +48,7 @@ function validateAccount() { |
|
|
if (/^[0-9]+$/.test(account)) {
|
|
|
|
|
|
//如果是纯数字,则作为手机号码处理
|
|
|
if (mailPhoneRegx.phoneRegx['+' + $countryCodeHide.val()].test(account)) {
|
|
|
if (mailPhoneRegx.phoneRegx[$countryCodeHide.val()].test(account)) {
|
|
|
pass = true;
|
|
|
} else {
|
|
|
pass = false;
|
...
|
...
|
@@ -97,6 +99,7 @@ function validatePassword() { |
|
|
$passwordTip.removeClass('hide').children('em').text(err);
|
|
|
$password.addClass('error');
|
|
|
}
|
|
|
return pass;
|
|
|
}
|
|
|
|
|
|
//验证
|
...
|
...
|
@@ -254,7 +257,29 @@ $('.va').on('focus', function() { |
|
|
$('#login-btn').on('click', function() {
|
|
|
var pass = validate();
|
|
|
|
|
|
if (pass) {
|
|
|
$('#login-form').submit();
|
|
|
if (pass && authing === false) {
|
|
|
authing = true;
|
|
|
|
|
|
$.ajax({
|
|
|
url: '/passport/login/auth',
|
|
|
type: 'POST',
|
|
|
data: {
|
|
|
areaCode: $countryCodeHide.val().replace('+', ''),
|
|
|
account: $.trim($account.val()),
|
|
|
password: $.trim($password.val())
|
|
|
},
|
|
|
success: function(data) {
|
|
|
if (data.code === 400) {
|
|
|
$passwordTip.removeClass('hide').children('em').text(data.message);
|
|
|
$password.addClass('error');
|
|
|
return;
|
|
|
} else {
|
|
|
location.href = data.data.href;
|
|
|
}
|
|
|
},
|
|
|
complete: function() {
|
|
|
authing = false;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|