Authored by lore-w

注册逻辑修改 code review by liuyue

<div class="register-page">
<form id="register-form" class="register-form" method="POST" action="{{actionUrl}}" autocomplete="off">
<!--<form id="register-form" class="register-form" method="POST" action="{{actionUrl}}" autocomplete="off">-->
<ul>
<li class="clearfix">
<select id="region" class="region" name="region">
... ... @@ -64,5 +64,5 @@
<span></span>
<b></b>
</div>
</form>
<!--</form>-->
</div>
\ No newline at end of file
... ...
... ... @@ -97,8 +97,8 @@ function phoneAjaxFn(callback) {
validateResult[0].message = '';
validateResult[0].status = true;
break;
case 404:
validateResult[0].message = '改账号已经存在';
case 400:
validateResult[0].message = data.message;
validateResult[0].status = false;
break;
}
... ... @@ -464,7 +464,48 @@ $registerBtn.click(function() {
if ($(this).hasClass('disable')) {
return;
} else {
('#register-form').submit();
//ajax提交
$.ajax({
type: 'POST',
url: '/passport/register/mobileregister',
data: {
area: $region.text().split('+')[1],
mobile: $pn.val(),
captcha: $ca.val(),
code: $mc.val(),
password: $pwd.val()
}
}).then(function(data) {
var time = 0,
t,
refer = data.href;
t = setTimeout(function() {
time++;
}, 1000);
$.ajax({
type: 'POST',
url: '/passport/register/mobileregister',
data: {
session: data.session
}
}).then(function(data) {
if (data.code === 200 && t < 3) {
clearInterval(t);
location.href = refer;
}
});
if (t >= 3) {
clearInterval(t);
location.href = refer;
}
});
}
});
... ...
... ... @@ -11,7 +11,7 @@
color: #b9b9b9;
}
.register-form {
.register-page {
height: auto;
li {
... ...