|
@@ -51,47 +51,47 @@ $(document).ready(function () {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
let account = $("#inputEmail").val();
|
|
let account = $("#inputEmail").val();
|
|
|
- let pw = $("#inputPassword").val();
|
|
|
|
|
|
|
+ // let pw = $("#inputPassword").val();
|
|
|
|
|
|
|
|
// 判断输入的邮箱/手机是否格式正确
|
|
// 判断输入的邮箱/手机是否格式正确
|
|
|
if(/^1[3456789]\d{9}$/.test(account) || /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(account)) {
|
|
if(/^1[3456789]\d{9}$/.test(account) || /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(account)) {
|
|
|
// 先判断是否是专业版用户,是的话弹出短信验证
|
|
// 先判断是否是专业版用户,是的话弹出短信验证
|
|
|
- $.ajax({
|
|
|
|
|
- url: '/accountIsPro',
|
|
|
|
|
- type: 'post',
|
|
|
|
|
- async: true,
|
|
|
|
|
- data: {"account": account, "pw": pw},
|
|
|
|
|
- success: function (response) {
|
|
|
|
|
- if (response.error === 0) {
|
|
|
|
|
- const ispro = response.result;
|
|
|
|
|
- if (!ispro) {
|
|
|
|
|
|
|
+ // $.ajax({
|
|
|
|
|
+ // url: '/accountIsPro',
|
|
|
|
|
+ // type: 'post',
|
|
|
|
|
+ // async: true,
|
|
|
|
|
+ // data: {"account": account, "pw": pw},
|
|
|
|
|
+ // success: function (response) {
|
|
|
|
|
+ // if (response.error === 0) {
|
|
|
|
|
+ // const ispro = response.result;
|
|
|
|
|
+ // if (!ispro) {
|
|
|
login(captchaObj);
|
|
login(captchaObj);
|
|
|
- } else {
|
|
|
|
|
- $('#phonepass').modal('show');
|
|
|
|
|
- $('#proMobile').val(response.data);
|
|
|
|
|
- $('#pro_mobile').text(response.data.substr(0, 3) + '****' + response.data.substr(7, 11));
|
|
|
|
|
- }
|
|
|
|
|
- } else if(response.error === 2) {
|
|
|
|
|
- $('#check_ssoId').val(response.ssoId);
|
|
|
|
|
- $('#phone').modal('show');
|
|
|
|
|
- } else {
|
|
|
|
|
- let msg = response.msg !== undefined ? response.msg : '未知错误';
|
|
|
|
|
- showError(msg, $("input"));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // $('#phonepass').modal('show');
|
|
|
|
|
+ // $('#proMobile').val(response.data);
|
|
|
|
|
+ // $('#pro_mobile').text(response.data.substr(0, 3) + '****' + response.data.substr(7, 11));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // } else if(response.error === 2) {
|
|
|
|
|
+ // $('#check_ssoId').val(response.ssoId);
|
|
|
|
|
+ // $('#phone').modal('show');
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // let msg = response.msg !== undefined ? response.msg : '未知错误';
|
|
|
|
|
+ // showError(msg, $("input"));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
} else {
|
|
} else {
|
|
|
$('#emailHelp').text('您输入的 邮箱/手机 格式不对');
|
|
$('#emailHelp').text('您输入的 邮箱/手机 格式不对');
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- $('#loginPro').click(function () {
|
|
|
|
|
- if ($('#smsCode').val() === '') {
|
|
|
|
|
- showValidError('请输入验证码',$('#smsCode'));
|
|
|
|
|
- } else {
|
|
|
|
|
- login(captchaObj);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // $('#loginPro').click(function () {
|
|
|
|
|
+ // if ($('#smsCode').val() === '') {
|
|
|
|
|
+ // showValidError('请输入验证码',$('#smsCode'));
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // login(captchaObj);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
|
|
|
$('#check-code').click(function () {
|
|
$('#check-code').click(function () {
|
|
|
const mobile = $("#mobile").val();
|
|
const mobile = $("#mobile").val();
|
|
@@ -172,32 +172,32 @@ $(document).ready(function () {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- $("#get-code2").click(function() {
|
|
|
|
|
- const mobile = $("#proMobile").val();
|
|
|
|
|
- if(!validMobile(mobile)){
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- const btn = $(this);
|
|
|
|
|
- if(!btn.hasClass('disabled')){
|
|
|
|
|
- $.ajax({
|
|
|
|
|
- url: '/sms/code',
|
|
|
|
|
- type: 'post',
|
|
|
|
|
- data: { mobile: mobile, type: 3},
|
|
|
|
|
- error: function() {
|
|
|
|
|
- showValidError('短信接口出错!',$('#smsCode'));
|
|
|
|
|
- },
|
|
|
|
|
- beforeSend: function() {
|
|
|
|
|
- },
|
|
|
|
|
- success: function(response) {
|
|
|
|
|
- if (response.err === 0) {
|
|
|
|
|
- codeSuccess(btn);
|
|
|
|
|
- } else {
|
|
|
|
|
- showValidError(response.msg,$('#smsCode'));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // $("#get-code2").click(function() {
|
|
|
|
|
+ // const mobile = $("#proMobile").val();
|
|
|
|
|
+ // if(!validMobile(mobile)){
|
|
|
|
|
+ // return false;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // const btn = $(this);
|
|
|
|
|
+ // if(!btn.hasClass('disabled')){
|
|
|
|
|
+ // $.ajax({
|
|
|
|
|
+ // url: '/sms/code',
|
|
|
|
|
+ // type: 'post',
|
|
|
|
|
+ // data: { mobile: mobile, type: 3},
|
|
|
|
|
+ // error: function() {
|
|
|
|
|
+ // showValidError('短信接口出错!',$('#smsCode'));
|
|
|
|
|
+ // },
|
|
|
|
|
+ // beforeSend: function() {
|
|
|
|
|
+ // },
|
|
|
|
|
+ // success: function(response) {
|
|
|
|
|
+ // if (response.err === 0) {
|
|
|
|
|
+ // codeSuccess(btn);
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // showValidError(response.msg,$('#smsCode'));
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
function login(captchaObj) {
|
|
function login(captchaObj) {
|
|
@@ -206,7 +206,7 @@ function login(captchaObj) {
|
|
|
let geetest_challenge = $('input[name="geetest_challenge"]').val();
|
|
let geetest_challenge = $('input[name="geetest_challenge"]').val();
|
|
|
let geetest_validate = $('input[name="geetest_validate"]').val();
|
|
let geetest_validate = $('input[name="geetest_validate"]').val();
|
|
|
let geetest_seccode = $('input[name="geetest_seccode"]').val();
|
|
let geetest_seccode = $('input[name="geetest_seccode"]').val();
|
|
|
- let code = $("#smsCode").val();
|
|
|
|
|
|
|
+ // let code = $("#smsCode").val();
|
|
|
|
|
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
url: '/login',
|
|
url: '/login',
|
|
@@ -217,11 +217,11 @@ function login(captchaObj) {
|
|
|
"geetest_challenge": geetest_challenge,
|
|
"geetest_challenge": geetest_challenge,
|
|
|
"geetest_validate": geetest_validate,
|
|
"geetest_validate": geetest_validate,
|
|
|
"geetest_seccode": geetest_seccode,
|
|
"geetest_seccode": geetest_seccode,
|
|
|
- "code": code,
|
|
|
|
|
|
|
+ // "code": code,
|
|
|
},
|
|
},
|
|
|
success: function (response) {
|
|
success: function (response) {
|
|
|
if (response.error === 0) {
|
|
if (response.error === 0) {
|
|
|
- $('#phonepass').modal('hide');
|
|
|
|
|
|
|
+ // $('#phonepass').modal('hide');
|
|
|
const url = response.last_page !== null && response.last_page !== undefined && response.last_page !== '' ?
|
|
const url = response.last_page !== null && response.last_page !== undefined && response.last_page !== '' ?
|
|
|
response.last_page : '/pm';
|
|
response.last_page : '/pm';
|
|
|
if (response.login_ask === 0) {
|
|
if (response.login_ask === 0) {
|
|
@@ -238,14 +238,14 @@ function login(captchaObj) {
|
|
|
$('#ver').modal('show');
|
|
$('#ver').modal('show');
|
|
|
}
|
|
}
|
|
|
} else if(response.error === 2) {
|
|
} else if(response.error === 2) {
|
|
|
- $('#phonepass').modal('hide');
|
|
|
|
|
|
|
+ // $('#phonepass').modal('hide');
|
|
|
captchaObj.reset();
|
|
captchaObj.reset();
|
|
|
$('#check_ssoId').val(response.ssoId);
|
|
$('#check_ssoId').val(response.ssoId);
|
|
|
$('#phone').modal('show');
|
|
$('#phone').modal('show');
|
|
|
- } else if(response.error === 3) {
|
|
|
|
|
- showValidError(response.msg,$('#smsCode'));
|
|
|
|
|
|
|
+ // } else if(response.error === 3) {
|
|
|
|
|
+ // showValidError(response.msg,$('#smsCode'));
|
|
|
} else {
|
|
} else {
|
|
|
- $('#phonepass').modal('hide');
|
|
|
|
|
|
|
+ // $('#phonepass').modal('hide');
|
|
|
let msg = response.msg !== undefined ? response.msg : '未知错误';
|
|
let msg = response.msg !== undefined ? response.msg : '未知错误';
|
|
|
showError(msg, $("input"));
|
|
showError(msg, $("input"));
|
|
|
captchaObj.reset();
|
|
captchaObj.reset();
|
|
@@ -292,7 +292,7 @@ function validMobile(mobile) {
|
|
|
showValidError('手机号不能为空!',$('#mobile'));
|
|
showValidError('手机号不能为空!',$('#mobile'));
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- let mobileValid = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1})|(14[0-9]{1}))+\d{8})$/;
|
|
|
|
|
|
|
+ let mobileValid = /^1[3456789]\d{9}$/;
|
|
|
if(!mobileValid.test(mobile)){
|
|
if(!mobileValid.test(mobile)){
|
|
|
showValidError('手机号码格式有误!',$('#mobile'));
|
|
showValidError('手机号码格式有误!',$('#mobile'));
|
|
|
return false;
|
|
return false;
|