...
|
...
|
@@ -60,6 +60,15 @@ function disableSMSBtn() { |
|
|
}
|
|
|
}
|
|
|
|
|
|
// 刷新图形验证码
|
|
|
function refreshImgCaptcha() {
|
|
|
var time = new Date(),
|
|
|
$captchaImg = $('.img-captcha'),
|
|
|
captchaImgSrc = $captchaImg.attr('src').split('?')[0];
|
|
|
|
|
|
$captchaImg.attr('src', captchaImgSrc + '?t=' + time.getTime());
|
|
|
}
|
|
|
|
|
|
// 发送短信验证码
|
|
|
function sendSMSCaptcha() {
|
|
|
return $.ajax({
|
...
|
...
|
@@ -69,18 +78,15 @@ function sendSMSCaptcha() { |
|
|
mobile: $phoneNumInput.val(),
|
|
|
area: $regionCodeText.text().replace('+', '')
|
|
|
}
|
|
|
}).then(function(ret) {
|
|
|
if (ret && ret.code === 400) {
|
|
|
errTip($imgCaptchaInput, ret.message);
|
|
|
refreshImgCaptcha();
|
|
|
ep.emit('img-captcha', false);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 刷新图形验证码
|
|
|
function refreshImgCaptcha() {
|
|
|
var time = new Date(),
|
|
|
$captchaImg = $('.img-captcha'),
|
|
|
captchaImgSrc = $captchaImg.attr('src').split('?')[0];
|
|
|
|
|
|
$captchaImg.attr('src', captchaImgSrc + '?t=' + time.getTime());
|
|
|
}
|
|
|
|
|
|
// 异步验证图形码
|
|
|
function validateImgCaptchaAsync() {
|
|
|
return $.ajax({
|
...
|
...
|
@@ -268,10 +274,17 @@ $smsCaptchaCtrl.on('click', function() { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
validateImgCaptchaAsync().then(function(result) {
|
|
|
if (result.code === 200) {
|
|
|
$smsCaptchaCtrl.addClass('disable');
|
|
|
|
|
|
disableSMSBtn();
|
|
|
sendSMSCaptcha();
|
|
|
} else {
|
|
|
ep.emit('img-captcha', false);
|
|
|
errTip($imgCaptchaInput, '图形验证码错误');
|
|
|
refreshImgCaptcha();
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
// 统一设置用户信息
|
...
|
...
|
|