|
@@ -100,16 +100,17 @@
|
|
|
dataType: "json",
|
|
|
cache: false,
|
|
|
data: {"mobile": $(this).val()},
|
|
|
- url: "{{rootUrl}}user/profile/check/mobile"
|
|
|
- }).done(function(data){
|
|
|
- if (data["mobile"] > 0) {
|
|
|
- $("#input_error").addClass('error');
|
|
|
- $("#help-inline").html('手机号码已被使用');
|
|
|
- $("#help-inline").show();
|
|
|
- } else {
|
|
|
- $("#input_error").removeClass('error');
|
|
|
- $("#help-inline").hide();
|
|
|
- }
|
|
|
+ url: "{{rootUrl}}user/profile/check/mobile",
|
|
|
+ success: function(data){
|
|
|
+ if (data["mobile"] > 0) {
|
|
|
+ $("#input_error").addClass('error');
|
|
|
+ $("#help-inline").html('手机号码已被使用');
|
|
|
+ $("#help-inline").show();
|
|
|
+ } else {
|
|
|
+ $("#input_error").removeClass('error');
|
|
|
+ $("#help-inline").hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
});
|
|
|
|
|
@@ -145,36 +146,40 @@
|
|
|
dataType: "json",
|
|
|
cache: false,
|
|
|
data: {"mobile": $("#mobile").val()},
|
|
|
- url: "{{rootUrl}}user/profile/check/mobile"
|
|
|
- }).done(function(data) {
|
|
|
- if (data["mobile"] > 0) {
|
|
|
- $("#input_error").addClass('error');
|
|
|
- $("#help-inline").html('手机号码已被使用');
|
|
|
- $("#help-inline").show();
|
|
|
- return false;
|
|
|
- } else {
|
|
|
- $("#input_error").removeClass('error');
|
|
|
- $("#help-inline").hide();
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- dataType: "json",
|
|
|
- cache: false,
|
|
|
- data: {"mobile": $("#mobile").val()},
|
|
|
- url: "{{rootUrl}}user/profile/sms/send/verify"
|
|
|
- }).done(function (data) {
|
|
|
- });
|
|
|
- var count = 60;
|
|
|
- var resend = setInterval(function () {
|
|
|
- count--;
|
|
|
- if (count > 0) {
|
|
|
- btn.val('重新获取 ' + count + 's');
|
|
|
- $.cookie("sms", count, {path: '/', expires: (1 / 86400) * count});
|
|
|
- } else {
|
|
|
- clearInterval(resend);
|
|
|
- btn.val("获取验证码").removeAttr('disabled style');
|
|
|
- }
|
|
|
- }, 1000);
|
|
|
- btn.attr('disabled', true).css('cursor', 'not-allowed');
|
|
|
+ url: "{{rootUrl}}user/profile/check/mobile",
|
|
|
+ success: function(data){
|
|
|
+ if (data["mobile"] > 0) {
|
|
|
+ $("#input_error").addClass('error');
|
|
|
+ $("#help-inline").html('手机号码已被使用');
|
|
|
+ $("#help-inline").show();
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ $("#input_error").removeClass('error');
|
|
|
+ $("#help-inline").hide();
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ dataType: "json",
|
|
|
+ cache: false,
|
|
|
+ data: {"mobile": $("#mobile").val()},
|
|
|
+ url: "{{rootUrl}}user/profile/sms/send/verify",
|
|
|
+ success: function(data){
|
|
|
+ if(data["verify"]==true){
|
|
|
+ var count = 60;
|
|
|
+ var resend = setInterval(function () {
|
|
|
+ count--;
|
|
|
+ if (count > 0) {
|
|
|
+ btn.val('重新获取 ' + count + 's');
|
|
|
+ $.cookie("sms", count, {path: '/', expires: (1 / 86400) * count});
|
|
|
+ } else {
|
|
|
+ clearInterval(resend);
|
|
|
+ btn.val("获取验证码").removeAttr('disabled style');
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
+ btn.attr('disabled', true).css('cursor', 'not-allowed');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -186,10 +191,13 @@
|
|
|
dataType: "json",
|
|
|
cache: false,
|
|
|
data: {"mobile": $("#mobile").val(), "verifycode": $("#verifycode").val()},
|
|
|
- url: "{{rootUrl}}user/profile/sms"
|
|
|
- }).done(function (data) {
|
|
|
-// window.location.href = "{{rootUrl}}user/profile/sms";
|
|
|
- window.location.reload();
|
|
|
+ url: "{{rootUrl}}user/profile/sms",
|
|
|
+ error: function (err) {
|
|
|
+ alert(err);
|
|
|
+ },
|
|
|
+ success: function () {
|
|
|
+ window.location.href = "{{rootUrl}}user/profile/sms";
|
|
|
+ }
|
|
|
});
|
|
|
});
|
|
|
});
|