...
|
...
|
@@ -73,6 +73,8 @@ $loginBtn.on('touchstart', function() { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
$loginBtn.text('正在登录...').addClass('disable');
|
|
|
|
|
|
if (api.phoneRegx[areaCode].test(pn) && api.pwdValidate(pwd)) {
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
...
|
...
|
@@ -83,7 +85,8 @@ $loginBtn.on('touchstart', function() { |
|
|
password: pwd
|
|
|
},
|
|
|
success: function(data) {
|
|
|
var res;
|
|
|
var res,
|
|
|
time;
|
|
|
|
|
|
if (data.code === 200) {
|
|
|
res = data.data;
|
...
|
...
|
@@ -91,19 +94,32 @@ $loginBtn.on('touchstart', function() { |
|
|
|
|
|
$.ajax({
|
|
|
url: res.session,
|
|
|
dataType: 'jsonp'
|
|
|
});
|
|
|
dataType: 'jsonp',
|
|
|
success: function() {
|
|
|
clearTimeout(time);
|
|
|
|
|
|
//2000ms后跳转页面
|
|
|
//Cookie写入成功后,1s后跳转页面
|
|
|
setTimeout(function() {
|
|
|
location.href = res.href;
|
|
|
}, 2000);
|
|
|
}, 1000);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//3秒后强制跳转
|
|
|
time = setTimeout(function() {
|
|
|
location.href = res.href;
|
|
|
}, 3000);
|
|
|
|
|
|
showErrTip('登录成功');
|
|
|
} else {
|
|
|
showErrTip(data.message);
|
|
|
}
|
|
|
},
|
|
|
error: function() {
|
|
|
showErrTip('网络断开连接啦~');
|
|
|
},
|
|
|
complete: function() {
|
|
|
$loginBtn.text('登录').removeClass('disable');
|
|
|
}
|
|
|
});
|
|
|
} else {
|
...
|
...
|
|