Showing
9 changed files
with
34 additions
and
22 deletions
@@ -16,12 +16,13 @@ $resend.on('touchstart', function(e) { | @@ -16,12 +16,13 @@ $resend.on('touchstart', function(e) { | ||
16 | 16 | ||
17 | $.ajax({ | 17 | $.ajax({ |
18 | url: $resend.data('url'), | 18 | url: $resend.data('url'), |
19 | - type: 'GET' | ||
20 | - }).then(function(data) { | 19 | + type: 'GET', |
20 | + success: function(data) { | ||
21 | if (data.code === 200) { | 21 | if (data.code === 200) { |
22 | showErrTip(data.message); | 22 | showErrTip(data.message); |
23 | } else { | 23 | } else { |
24 | showErrTip(data.message); | 24 | showErrTip(data.message); |
25 | } | 25 | } |
26 | + } | ||
26 | }); | 27 | }); |
27 | }); | 28 | }); |
@@ -37,13 +37,14 @@ $btnSure.on('touchstart', function() { | @@ -37,13 +37,14 @@ $btnSure.on('touchstart', function() { | ||
37 | type: 'POST', | 37 | type: 'POST', |
38 | data: { | 38 | data: { |
39 | email: email | 39 | email: email |
40 | - } | ||
41 | - }).then(function(data) { | 40 | + }, |
41 | + success: function(data) { | ||
42 | if (data.code === 200) { | 42 | if (data.code === 200) { |
43 | location.href = data.data; | 43 | location.href = data.data; |
44 | } else { | 44 | } else { |
45 | showErrTip(data.message); | 45 | showErrTip(data.message); |
46 | } | 46 | } |
47 | + } | ||
47 | }); | 48 | }); |
48 | } else { | 49 | } else { |
49 | showErrTip('邮箱格式不正确,请重新输入'); | 50 | showErrTip('邮箱格式不正确,请重新输入'); |
@@ -45,13 +45,14 @@ $btnNext.on('touchstart', function() { | @@ -45,13 +45,14 @@ $btnNext.on('touchstart', function() { | ||
45 | data: { | 45 | data: { |
46 | area: country.split('+')[1], | 46 | area: country.split('+')[1], |
47 | mobile: pn | 47 | mobile: pn |
48 | - } | ||
49 | - }).then(function(data) { | 48 | + }, |
49 | + success: function(data) { | ||
50 | if (data.code === 200) { | 50 | if (data.code === 200) { |
51 | location.href = '/passport/back/code'; | 51 | location.href = '/passport/back/code'; |
52 | } else { | 52 | } else { |
53 | showErrTip(data.message); | 53 | showErrTip(data.message); |
54 | } | 54 | } |
55 | + } | ||
55 | }); | 56 | }); |
56 | } else { | 57 | } else { |
57 | showErrTip('手机号格式不正确,请重新输入'); | 58 | showErrTip('手机号格式不正确,请重新输入'); |
@@ -37,8 +37,8 @@ $btnOk.on('touchstart', function() { | @@ -37,8 +37,8 @@ $btnOk.on('touchstart', function() { | ||
37 | url: '/passport/back/update', | 37 | url: '/passport/back/update', |
38 | data: { | 38 | data: { |
39 | password: pwd | 39 | password: pwd |
40 | - } | ||
41 | - }).then(function(data) { | 40 | + }, |
41 | + success: function(data) { | ||
42 | if (data.code === 200) { | 42 | if (data.code === 200) { |
43 | showErrTip('密码修改成功'); | 43 | showErrTip('密码修改成功'); |
44 | 44 | ||
@@ -49,6 +49,7 @@ $btnOk.on('touchstart', function() { | @@ -49,6 +49,7 @@ $btnOk.on('touchstart', function() { | ||
49 | } else { | 49 | } else { |
50 | showErrTip(data.message); | 50 | showErrTip(data.message); |
51 | } | 51 | } |
52 | + } | ||
52 | }); | 53 | }); |
53 | } else { | 54 | } else { |
54 | showErrTip('密码6-20位,请重新输入'); | 55 | showErrTip('密码6-20位,请重新输入'); |
@@ -50,8 +50,8 @@ module.exports = function(useInRegister) { | @@ -50,8 +50,8 @@ module.exports = function(useInRegister) { | ||
50 | 50 | ||
51 | $.ajax({ | 51 | $.ajax({ |
52 | type: 'POST', | 52 | type: 'POST', |
53 | - url: '/passport/' + urlMid + '/sendPhone' | ||
54 | - }).then(function (data) { | 53 | + url: '/passport/' + urlMid + '/sendPhone', |
54 | + success: function(data) { | ||
55 | if (data.code === 200) { | 55 | if (data.code === 200) { |
56 | $captchaTip.text('重发验证码 (60秒)').addClass('disable'); | 56 | $captchaTip.text('重发验证码 (60秒)').addClass('disable'); |
57 | countDown(); | 57 | countDown(); |
@@ -60,6 +60,7 @@ module.exports = function(useInRegister) { | @@ -60,6 +60,7 @@ module.exports = function(useInRegister) { | ||
60 | //验证码不正确,显示提示 | 60 | //验证码不正确,显示提示 |
61 | showErrTip(data.message); | 61 | showErrTip(data.message); |
62 | } | 62 | } |
63 | + } | ||
63 | }); | 64 | }); |
64 | }); | 65 | }); |
65 | 66 | ||
@@ -73,8 +74,8 @@ module.exports = function(useInRegister) { | @@ -73,8 +74,8 @@ module.exports = function(useInRegister) { | ||
73 | url: '/passport/' + urlMid + '/verifycode', | 74 | url: '/passport/' + urlMid + '/verifycode', |
74 | data: { | 75 | data: { |
75 | verifyCode: trim($captcha.val()) | 76 | verifyCode: trim($captcha.val()) |
76 | - } | ||
77 | - }).then(function (data) { | 77 | + }, |
78 | + success: function(data) { | ||
78 | if (data.code === 200) { | 79 | if (data.code === 200) { |
79 | location.href = data.data; | 80 | location.href = data.data; |
80 | } else { | 81 | } else { |
@@ -82,6 +83,7 @@ module.exports = function(useInRegister) { | @@ -82,6 +83,7 @@ module.exports = function(useInRegister) { | ||
82 | //验证码不正确,显示提示 | 83 | //验证码不正确,显示提示 |
83 | showErrTip(data.message); | 84 | showErrTip(data.message); |
84 | } | 85 | } |
86 | + } | ||
85 | }); | 87 | }); |
86 | }); | 88 | }); |
87 | 89 |
@@ -81,8 +81,8 @@ $loginBtn.on('touchstart', function() { | @@ -81,8 +81,8 @@ $loginBtn.on('touchstart', function() { | ||
81 | area: country.split('+')[1], | 81 | area: country.split('+')[1], |
82 | account: pn, | 82 | account: pn, |
83 | pwd: pwd | 83 | pwd: pwd |
84 | - } | ||
85 | - }).then(function(data) { | 84 | + }, |
85 | + success: function(data) { | ||
86 | if (data.code === 200) { | 86 | if (data.code === 200) { |
87 | showErrTip('登录成功'); | 87 | showErrTip('登录成功'); |
88 | 88 | ||
@@ -93,8 +93,10 @@ $loginBtn.on('touchstart', function() { | @@ -93,8 +93,10 @@ $loginBtn.on('touchstart', function() { | ||
93 | } else { | 93 | } else { |
94 | showErrTip(data.message); | 94 | showErrTip(data.message); |
95 | } | 95 | } |
96 | - }, function() { | 96 | + }, |
97 | + error: function() { | ||
97 | showErrTip('网络断开连接啦~'); | 98 | showErrTip('网络断开连接啦~'); |
99 | + } | ||
98 | }); | 100 | }); |
99 | } else { | 101 | } else { |
100 | showErrTip('账号或密码有错误,请重新输入'); | 102 | showErrTip('账号或密码有错误,请重新输入'); |
@@ -84,8 +84,8 @@ $loginBtn.on('touchstart', function() { | @@ -84,8 +84,8 @@ $loginBtn.on('touchstart', function() { | ||
84 | data: { | 84 | data: { |
85 | account: acc, | 85 | account: acc, |
86 | pwd: pwd | 86 | pwd: pwd |
87 | - } | ||
88 | - }).then(function(data) { | 87 | + }, |
88 | + success: function(data) { | ||
89 | if (data.code === 200) { | 89 | if (data.code === 200) { |
90 | showErrTip('登录成功'); | 90 | showErrTip('登录成功'); |
91 | 91 | ||
@@ -96,8 +96,10 @@ $loginBtn.on('touchstart', function() { | @@ -96,8 +96,10 @@ $loginBtn.on('touchstart', function() { | ||
96 | } else { | 96 | } else { |
97 | showErrTip(data.message); | 97 | showErrTip(data.message); |
98 | } | 98 | } |
99 | - }, function() { | 99 | + }, |
100 | + error: function() { | ||
100 | showErrTip('网络断开连接啦~'); | 101 | showErrTip('网络断开连接啦~'); |
102 | + } | ||
101 | }); | 103 | }); |
102 | } else { | 104 | } else { |
103 | showErrTip('账号或密码有错误,请重新输入'); | 105 | showErrTip('账号或密码有错误,请重新输入'); |
@@ -39,8 +39,8 @@ $btnSure.on('touchstart', function() { | @@ -39,8 +39,8 @@ $btnSure.on('touchstart', function() { | ||
39 | url: '/passport/register/regmobile', | 39 | url: '/passport/register/regmobile', |
40 | data: { | 40 | data: { |
41 | password: pwd | 41 | password: pwd |
42 | - } | ||
43 | - }).then(function(data) { | 42 | + }, |
43 | + success: function(data) { | ||
44 | if (data.code === 200) { | 44 | if (data.code === 200) { |
45 | showErrTip('注册成功'); | 45 | showErrTip('注册成功'); |
46 | 46 | ||
@@ -58,6 +58,7 @@ $btnSure.on('touchstart', function() { | @@ -58,6 +58,7 @@ $btnSure.on('touchstart', function() { | ||
58 | }, 1000); | 58 | }, 1000); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | + } | ||
61 | }); | 62 | }); |
62 | } | 63 | } |
63 | }); | 64 | }); |
@@ -45,13 +45,14 @@ $btnNext.on('touchstart', function() { | @@ -45,13 +45,14 @@ $btnNext.on('touchstart', function() { | ||
45 | data: { | 45 | data: { |
46 | area: country.split('+')[1], | 46 | area: country.split('+')[1], |
47 | profile: pn | 47 | profile: pn |
48 | - } | ||
49 | - }).then(function(data) { | 48 | + }, |
49 | + success: function(data) { | ||
50 | if (data.code === 200) { | 50 | if (data.code === 200) { |
51 | location.href = '/passport/register/code'; | 51 | location.href = '/passport/register/code'; |
52 | } else { | 52 | } else { |
53 | showErrTip(data.message); | 53 | showErrTip(data.message); |
54 | } | 54 | } |
55 | + } | ||
55 | }); | 56 | }); |
56 | } else { | 57 | } else { |
57 | showErrTip('手机号格式不正确,请重新输入'); | 58 | showErrTip('手机号格式不正确,请重新输入'); |
-
Please register or login to post a comment