...
|
...
|
@@ -9,6 +9,10 @@ module.exports = function(useInRegister, useForBind) { |
|
|
var $captcha = $('#captcha'),
|
|
|
$btnNext = $('#btn-next'),
|
|
|
$captchaTip = $('#captcha-tip'),
|
|
|
isReg = parseInt($('#isReg').val()),
|
|
|
nickname = $('#nickname').val(),
|
|
|
sourceType = $('#sourceType').val(),
|
|
|
openId = $('#openId').val(),
|
|
|
phoneNum = $('#phone-num').val(),
|
|
|
areaCode = $('#area-code').val().replace('+', '');
|
|
|
|
...
|
...
|
@@ -20,6 +24,34 @@ module.exports = function(useInRegister, useForBind) { |
|
|
|
|
|
var urlMid = useInRegister ? 'reg' : 'back';
|
|
|
|
|
|
function startBind() {
|
|
|
$.ajax({
|
|
|
url: '/passport/bind/bindMobile',
|
|
|
type: 'post',
|
|
|
data: {
|
|
|
areaCode: areaCode.replace('+', ''),
|
|
|
phoneNum: phoneNum,
|
|
|
openId: openId,
|
|
|
sourceType: sourceType,
|
|
|
nickname: nickname,
|
|
|
password: ''
|
|
|
},
|
|
|
success: function(res) {
|
|
|
if (res.code === 200) {
|
|
|
tip.show('登录成功');
|
|
|
setTimeout(function() {
|
|
|
location.href = res.data.refer;
|
|
|
}, 2000);
|
|
|
} else {
|
|
|
tip.show(res.message);
|
|
|
}
|
|
|
},
|
|
|
error: function(err) {
|
|
|
tip.show('登录失败,请重试!');
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function countDown() {
|
|
|
var count = 59,
|
|
|
itime;
|
...
|
...
|
@@ -77,7 +109,7 @@ module.exports = function(useInRegister, useForBind) { |
|
|
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: useForBind ? '/passport/bind/sendBindMsg' : '/passport/' + urlMid + '/verifycode',
|
|
|
url: useForBind ? '/passport/bind/checkBindMsg' : '/passport/' + urlMid + '/verifycode',
|
|
|
data: {
|
|
|
phoneNum: phoneNum,
|
|
|
areaCode: areaCode,
|
...
|
...
|
@@ -85,13 +117,22 @@ module.exports = function(useInRegister, useForBind) { |
|
|
token: $('#token').val()
|
|
|
},
|
|
|
success: function(data) {
|
|
|
if (data.code === 200) {
|
|
|
location.href = data.data;
|
|
|
} else {
|
|
|
if (data.code === 200) {
|
|
|
if (useForBind) {
|
|
|
if (isReg) {
|
|
|
startBind();
|
|
|
} else {
|
|
|
location.href = '/passport/bind/password?phoneNum=' + phoneNum + '&areaCode=' + areaCode + '&openId=' + openId + '&sourceType=' + sourceType + '&nickname=' + nickname;
|
|
|
}
|
|
|
} else {
|
|
|
location.href = data.data;
|
|
|
}
|
|
|
} else {
|
|
|
|
|
|
//验证码不正确,显示提示
|
|
|
showErrTip(data.message);
|
|
|
}
|
|
|
|
|
|
//验证码不正确,显示提示
|
|
|
showErrTip(data.message);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
...
|
...
|
|