...
|
...
|
@@ -29,33 +29,6 @@ var $cr = $('#country-code-hide'), |
|
|
require('../../simple-header');
|
|
|
require('yoho-jquery-placeholder');
|
|
|
require('../../common/promise');
|
|
|
require('../../common');
|
|
|
|
|
|
function authcode() {
|
|
|
return $.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/passport/back/authcode',
|
|
|
data: {
|
|
|
verifyCode: captcha.getResults(),
|
|
|
phoneNum: $phoneNum.val(),
|
|
|
area: $cr.val()
|
|
|
}
|
|
|
|
|
|
}).then(function(data) {
|
|
|
if (data.code === 200) {
|
|
|
$('#captcha-value').val(captcha.getResults());
|
|
|
return $.Deferred().resolve().promise(); //eslint-disable-line
|
|
|
} else if (data.code === 402) {
|
|
|
$accErr.removeClass('hide').find('em').text('该账号不存在');
|
|
|
$phoneNum.addClass('error');
|
|
|
captcha.refresh();
|
|
|
return $.Deferred().reject().promise();//eslint-disable-line
|
|
|
} else if (data.code === 405) {
|
|
|
captcha.showTip(data.message);
|
|
|
return $.Deferred().reject().promise();//eslint-disable-line
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function vaPn(v) {
|
|
|
var pass = true,
|
...
|
...
|
@@ -166,38 +139,37 @@ $btn.click(function(e) { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (!captcha.getResults()) {
|
|
|
captcha.showTip();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (/^[0-9]+$/.test($.trim($phoneNum.val()))) {
|
|
|
$('#find-form').attr('action', '/passport/back/mobile');
|
|
|
}
|
|
|
|
|
|
$('#captcha-value').val(captcha.getResults());
|
|
|
|
|
|
if (hasPh) {
|
|
|
authcode().then(function() {
|
|
|
$.post($('#back-form').attr('action'), {
|
|
|
phoneNum: $('#phone-num').val(),
|
|
|
area: $('#country-code-hide').val()
|
|
|
}).then(function(result) {
|
|
|
if (result.code === 200) {
|
|
|
window.jumpUrl(result.data.refer);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (result.code === 405) {
|
|
|
captcha.showTip(result.message);
|
|
|
$accErr.addClass('hide');
|
|
|
$phoneNum.removeClass('error');
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$accErr.removeClass('hide').find('em').text(result.message);
|
|
|
$.post('/passport/back/email', {
|
|
|
verifyCode: captcha.getResults(),
|
|
|
phoneNum: $('#phone-num').val(),
|
|
|
area: $('#country-code-hide').val()
|
|
|
}).then(function(result) {
|
|
|
if (result.code === 200) {
|
|
|
window.jumpUrl(result.data.refer);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (result.code === 402) {
|
|
|
$accErr.removeClass('hide').find('em').text('该账号不存在');
|
|
|
$phoneNum.addClass('error');
|
|
|
});
|
|
|
captcha.refresh();
|
|
|
return $.Deferred().reject().promise();//eslint-disable-line
|
|
|
}
|
|
|
|
|
|
if (result.code === 405) {
|
|
|
captcha.showTip(result.message);
|
|
|
$accErr.addClass('hide');
|
|
|
$phoneNum.removeClass('error');
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$accErr.removeClass('hide').find('em').text(result.message);
|
|
|
$phoneNum.addClass('error');
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
|