|
@@ -4,6 +4,9 @@ |
|
@@ -4,6 +4,9 @@ |
4
|
* @date: 2016/1/27
|
4
|
* @date: 2016/1/27
|
5
|
*/
|
5
|
*/
|
6
|
var $ = require('yoho-jquery');
|
6
|
var $ = require('yoho-jquery');
|
|
|
7
|
+
|
|
|
8
|
+var Captcha = require('../../plugins/captcha');
|
|
|
9
|
+var captcha = new Captcha('#captcha').init();
|
7
|
var dovalidate = false; // 校验验证码的标识
|
10
|
var dovalidate = false; // 校验验证码的标识
|
8
|
var isvalidatecode = false; // 是否验证成功的标识
|
11
|
var isvalidatecode = false; // 是否验证成功的标识
|
9
|
var isvalidatepwd = false; // 密码验证是否通过的标识
|
12
|
var isvalidatepwd = false; // 密码验证是否通过的标识
|
|
@@ -117,27 +120,31 @@ function sendMessageValidate() { |
|
@@ -117,27 +120,31 @@ function sendMessageValidate() { |
117
|
var area = '';
|
120
|
var area = '';
|
118
|
|
121
|
|
119
|
$(document).on('click', '#sendmessage', function() {
|
122
|
$(document).on('click', '#sendmessage', function() {
|
120
|
- circleTime();
|
123
|
+ captcha.hideTip();
|
121
|
mobile = $('#mobile').val();
|
124
|
mobile = $('#mobile').val();
|
122
|
area = $('#area').val();
|
125
|
area = $('#area').val();
|
123
|
$.ajax({
|
126
|
$.ajax({
|
124
|
type: 'POST',
|
127
|
type: 'POST',
|
125
|
- url: '/passport/autouserinfo/sendBindMsg',
|
128
|
+ url: '/passport/autouserinfo/sendBindMsgCode',
|
126
|
data: {
|
129
|
data: {
|
127
|
mobile: mobile,
|
130
|
mobile: mobile,
|
128
|
- area: area
|
131
|
+ area: area,
|
|
|
132
|
+ verifyCode: captcha.getResults()
|
129
|
}
|
133
|
}
|
130
|
}).then(function(data) {
|
134
|
}).then(function(data) {
|
131
|
- if (data.code !== 200) {
|
|
|
132
|
- alert(data.message); // eslint-disable-line
|
135
|
+ if (data.code === 200) {
|
|
|
136
|
+ circleTime();
|
|
|
137
|
+ return true;
|
|
|
138
|
+ } else if (data.code === 405) {
|
|
|
139
|
+ captcha.showTip(data.message);
|
|
|
140
|
+ return true;
|
133
|
}
|
141
|
}
|
134
|
- });
|
|
|
135
|
|
142
|
|
|
|
143
|
+ alert(data.message); // eslint-disable-line
|
|
|
144
|
+ });
|
136
|
});
|
145
|
});
|
137
|
}
|
146
|
}
|
138
|
|
147
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
function codeValidate() {
|
148
|
function codeValidate() {
|
142
|
var validatenum = '';
|
149
|
var validatenum = '';
|
143
|
|
150
|
|
|
@@ -298,8 +305,6 @@ function actionConfirm() { |
|
@@ -298,8 +305,6 @@ function actionConfirm() { |
298
|
});
|
305
|
});
|
299
|
}
|
306
|
}
|
300
|
|
307
|
|
301
|
-
|
|
|
302
|
-
|
|
|
303
|
function init() {
|
308
|
function init() {
|
304
|
$pwd = $('#pwd');
|
309
|
$pwd = $('#pwd');
|
305
|
$pwdParent = $('.safelevel');
|
310
|
$pwdParent = $('.safelevel');
|
|
@@ -309,9 +314,6 @@ function init() { |
|
@@ -309,9 +314,6 @@ function init() { |
309
|
codeValidate();
|
314
|
codeValidate();
|
310
|
validatePwd();
|
315
|
validatePwd();
|
311
|
actionConfirm();
|
316
|
actionConfirm();
|
312
|
-
|
|
|
313
|
- $('#sendmessage').click();
|
|
|
314
|
- circleTime(); // 倒计时
|
|
|
315
|
}
|
317
|
}
|
316
|
|
318
|
|
317
|
init(); |
319
|
init(); |