Authored by 徐炜

Merge remote-tracking branch 'origin/release/4.9.2' into release/4.9.2

... ... @@ -9,7 +9,7 @@ var $resendBtn,
var page = {
disableAjax: false,
time: 30,
time: 60,
resendText: '重发验证码',
timerId: null,
init: function() {
... ... @@ -119,9 +119,12 @@ var page = {
},
submit: function() {
var self = this;
var code = $.trim($smsCode.val());
if ($nextBtn.prop('disabled')) {
return;
}
$nextBtn.prop('disabled', this.disableAjax = true);
$.get('/passport/sms_login/check.json', {
code: code
... ... @@ -129,7 +132,7 @@ var page = {
.done(function(res) {
if (res.code === 200) {
location.href = res.redirect;
self.disableAjax = true; // 成功后 disabled, 执行跳转
$nextBtn.off();
return;
}
... ... @@ -137,10 +140,9 @@ var page = {
})
.fail(function() {
tip.show('出错了, 请重试');
self.disableAjax = false; // 失败后 允许再次 请求
})
.always(function() {
$nextBtn.prop('disabled', self.disableAjax);
$nextBtn.prop('disabled', false);
});
}
};
... ...
... ... @@ -78,6 +78,7 @@ var page = {
})
.done(function(data) {
if (data.code === 200) {
$nextBtn.off();
location.href = data.redirect;
} else {
tip.show(data.message);
... ...
... ... @@ -55,6 +55,7 @@ var page = {
})
.done(function(res) {
if (res.code === 200) {
$nextBtn.off();
location.href = res.redirect;
return;
}
... ...