注册逻辑修改 code review by liuyue
Showing
1 changed file
with
12 additions
and
6 deletions
@@ -538,18 +538,19 @@ exports.init = function(page) { | @@ -538,18 +538,19 @@ exports.init = function(page) { | ||
538 | 538 | ||
539 | var time = 0, | 539 | var time = 0, |
540 | t, | 540 | t, |
541 | - refer = data.href; | 541 | + refer; |
542 | + | ||
543 | + if (data.code === 200) { | ||
544 | + | ||
545 | + refer = data.data.href; | ||
542 | 546 | ||
543 | t = setTimeout(function() { | 547 | t = setTimeout(function() { |
544 | time++; | 548 | time++; |
545 | }, 1000); | 549 | }, 1000); |
546 | 550 | ||
547 | $.ajax({ | 551 | $.ajax({ |
548 | - type: 'POST', | ||
549 | - url: '/passport/register/mobileregister', | ||
550 | - data: { | ||
551 | - session: data.session | ||
552 | - } | 552 | + type: 'GET', |
553 | + url: data.data.session | ||
553 | }).then(function(data) { | 554 | }).then(function(data) { |
554 | 555 | ||
555 | if (data.code === 200 && t < 3) { | 556 | if (data.code === 200 && t < 3) { |
@@ -562,6 +563,11 @@ exports.init = function(page) { | @@ -562,6 +563,11 @@ exports.init = function(page) { | ||
562 | clearInterval(t); | 563 | clearInterval(t); |
563 | location.href = refer; | 564 | location.href = refer; |
564 | } | 565 | } |
566 | + } else { | ||
567 | + | ||
568 | + //todo | ||
569 | + console.log('网络超时~'); | ||
570 | + } | ||
565 | 571 | ||
566 | }); | 572 | }); |
567 | } | 573 | } |
-
Please register or login to post a comment