Authored by xuqi

unified ajax data attr

@@ -45,8 +45,8 @@ $btnNext.on('touchstart', function() { @@ -45,8 +45,8 @@ $btnNext.on('touchstart', function() {
45 url: '/passport/back/sendcode', 45 url: '/passport/back/sendcode',
46 type: 'POST', 46 type: 'POST',
47 data: { 47 data: {
48 - area: country.split('+')[1],  
49 - mobile: pn 48 + areaCode: country.split('+')[1],
  49 + phoneNum: pn
50 }, 50 },
51 success: function(data) { 51 success: function(data) {
52 if (data.code === 200) { 52 if (data.code === 200) {
@@ -14,7 +14,7 @@ var tip = require('../../plugin/tip'); @@ -14,7 +14,7 @@ var tip = require('../../plugin/tip');
14 var trim = $.trim; 14 var trim = $.trim;
15 var showErrTip = tip.show; 15 var showErrTip = tip.show;
16 16
17 -var $mobile = $('#mobile'); 17 +var $phoneNum = $('#phone-num');
18 18
19 api.bindEyesEvt(); 19 api.bindEyesEvt();
20 20
@@ -40,13 +40,13 @@ $btnOk.on('touchstart', function() { @@ -40,13 +40,13 @@ $btnOk.on('touchstart', function() {
40 password: pwd 40 password: pwd
41 }; 41 };
42 42
43 - if ($mobile.length === 0) { 43 + if ($phoneNum.length === 0) {
44 mobileBack = false; 44 mobileBack = false;
45 } 45 }
46 46
47 if (mobileBack) { 47 if (mobileBack) {
48 $.extend(setting, { 48 $.extend(setting, {
49 - mobile: $mobile.val(), 49 + phoneNum: $phoneNum.val(),
50 areaCode: $('#areaCode').val(), 50 areaCode: $('#areaCode').val(),
51 token: $('#token').val() 51 token: $('#token').val()
52 }); 52 });
@@ -72,7 +72,7 @@ $btnOk.on('touchstart', function() { @@ -72,7 +72,7 @@ $btnOk.on('touchstart', function() {
72 72
73 //1000ms后跳转页面 73 //1000ms后跳转页面
74 setTimeout(function() { 74 setTimeout(function() {
75 - location.href = '/'; 75 + location.href = data.data;
76 }, 1000); 76 }, 1000);
77 } else { 77 } else {
78 showErrTip(data.message); 78 showErrTip(data.message);
@@ -79,8 +79,8 @@ module.exports = function(useInRegister) { @@ -79,8 +79,8 @@ module.exports = function(useInRegister) {
79 type: 'POST', 79 type: 'POST',
80 url: '/passport/' + urlMid + '/verifycode', 80 url: '/passport/' + urlMid + '/verifycode',
81 data: { 81 data: {
82 - mobile: mobile,  
83 - area: area, 82 + phoneNum: mobile,
  83 + areaCode: area,
84 code: trim($captcha.val()), 84 code: trim($captcha.val()),
85 token: $('#token').val() 85 token: $('#token').val()
86 }, 86 },
@@ -78,9 +78,9 @@ $loginBtn.on('touchstart', function() { @@ -78,9 +78,9 @@ $loginBtn.on('touchstart', function() {
78 type: 'POST', 78 type: 'POST',
79 url: '/passport/signin/auth', 79 url: '/passport/signin/auth',
80 data: { 80 data: {
81 - area: country.split('+')[1],  
82 - account: pn,  
83 - pwd: pwd 81 + areaCode: country.split('+')[1],
  82 + phoneNum: pn,
  83 + password: pwd
84 }, 84 },
85 success: function(data) { 85 success: function(data) {
86 if (data.code === 200) { 86 if (data.code === 200) {
@@ -83,7 +83,7 @@ $loginBtn.on('touchstart', function() { @@ -83,7 +83,7 @@ $loginBtn.on('touchstart', function() {
83 url: '/passport/signin/auth', 83 url: '/passport/signin/auth',
84 data: { 84 data: {
85 account: acc, 85 account: acc,
86 - pwd: pwd 86 + password: pwd
87 }, 87 },
88 success: function(data) { 88 success: function(data) {
89 if (data.code === 200) { 89 if (data.code === 200) {
@@ -39,8 +39,8 @@ $btnSure.on('touchstart', function() { @@ -39,8 +39,8 @@ $btnSure.on('touchstart', function() {
39 url: '/passport/reg/setpassword', 39 url: '/passport/reg/setpassword',
40 data: { 40 data: {
41 password: pwd, 41 password: pwd,
42 - mobile: $('#phone-num').val(),  
43 - area: $('#area-code').val(), 42 + phoneNum: $('#phone-num').val(),
  43 + areaCode: $('#area-code').val(),
44 token: $('#token').val() 44 token: $('#token').val()
45 }, 45 },
46 success: function(data) { 46 success: function(data) {
@@ -45,8 +45,8 @@ $btnNext.on('touchstart', function() { @@ -45,8 +45,8 @@ $btnNext.on('touchstart', function() {
45 url: '/passport/reg/verifymobile', 45 url: '/passport/reg/verifymobile',
46 type: 'POST', 46 type: 'POST',
47 data: { 47 data: {
48 - area: country.split('+')[1],  
49 - mobile: pn 48 + areaCode: country.split('+')[1],
  49 + phoneNum: pn
50 }, 50 },
51 success: function(data) { 51 success: function(data) {
52 if (data.code === 200) { 52 if (data.code === 200) {
@@ -7,9 +7,9 @@ @@ -7,9 +7,9 @@
7 </div> 7 </div>
8 <span id="btn-ok" class="btn btn-ok disable">完成</span> 8 <span id="btn-ok" class="btn btn-ok disable">完成</span>
9 </div> 9 </div>
10 - {{#if mobile}}  
11 - <input id="mobile" type="hidden" value={{mobile}}>  
12 - <input id="area" type="hidden" value={{areaCode}}> 10 + {{#if phoneNum}}
  11 + <input id="phone-num" type="hidden" value={{phoneNum}}>
  12 + <input id="area-code" type="hidden" value={{areaCode}}>
13 <input id="token" type="hidden" value={{token}}> 13 <input id="token" type="hidden" value={{token}}>
14 {{/if}} 14 {{/if}}
15 15
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <div id="captcha-tip" class="captcha-tip disable">重发验证码 (60秒)</div> 11 <div id="captcha-tip" class="captcha-tip disable">重发验证码 (60秒)</div>
12 </div> 12 </div>
13 <span id="btn-next" class="btn btn-next disable row">下一步</span> 13 <span id="btn-next" class="btn btn-next disable row">下一步</span>
14 - <input id="mobile" type="hidden" value={{phoneNum}}>  
15 - <input id="area" type="hidden" value={{areaCode}}> 14 + <input id="phone-num" type="hidden" value={{phoneNum}}>
  15 + <input id="area-code" type="hidden" value={{areaCode}}>
16 <input id="token" type="hidden" value={{token}}> 16 <input id="token" type="hidden" value={{token}}>
17 </div> 17 </div>