获取验证码
@@ -295,7 +295,7 @@
x: parseInt(self.dom.find('.slide-image-small').position().left)
},
success: function(res) {
- if (res && res.code === 0) {
+ if (res && res.Code === 0) {
self.verifySucess = true;
self.canSendCode = true;
self.dom.find('.slide-bar').addClass('sucess');
@@ -338,9 +338,28 @@
var phoneNumber = self.dom.find('.phone-num-c input').val();
if (!/^1[3578]\d{9}$/.test(phoneNumber)) {
self.dom.find('.phone-num-c').addClass('error');
+ return;
} else {
self.dom.find('.phone-num-c').removeClass('error');
self.countDown();
+ $.ajax({
+ url: '/sendVerifyCode',
+ type: 'post',
+ dataType: 'json',
+ data: {
+ phone_number: phoneNumber,
+ mode: 0, // 0注册,1登录 ,2修改手机号,3找回密码
+ slide_id: self.imgID,
+ },
+ success: function(res) {
+ if (res && res.code === 0) {
+ console.log(res);
+ }
+ },
+ error: function(err) {
+ console.log(err);
+ }
+ });
}
});
};