|
|
@@ -46,102 +46,102 @@ $(document).ready(function () {
|
|
|
// // captchaObj.getValidate();
|
|
|
// });
|
|
|
|
|
|
- $("#login").click(function () {
|
|
|
- if (!valid()) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ($('#changeLogin').attr('data-status') === 'user') {
|
|
|
- let account = $("#inputEmail").val();
|
|
|
- if(/^1[3456789]\d{9}$/.test(account) || /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(account)) {
|
|
|
+ $("#login").click(function () {
|
|
|
+ if (!valid()) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($('#changeLogin').attr('data-status') === 'user') {
|
|
|
+ let account = $("#inputEmail").val();
|
|
|
+ if(/^1[3456789]\d{9}$/.test(account) || /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(account)) {
|
|
|
login();
|
|
|
- } else {
|
|
|
- $('#emailHelp').text('您输入的 邮箱/手机 格式不对');
|
|
|
- }
|
|
|
} else {
|
|
|
- let account = $("#mobileLogin").val();
|
|
|
- if(/^1[3456789]\d{9}$/.test(account)) {
|
|
|
+ $('#emailHelp').text('您输入的 邮箱/手机 格式不对');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let account = $("#mobileLogin").val();
|
|
|
+ if(/^1[3456789]\d{9}$/.test(account)) {
|
|
|
login();
|
|
|
- } else {
|
|
|
- $('#phoneHelp').text('您输入的 手机 格式不对');
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ $('#phoneHelp').text('您输入的 手机 格式不对');
|
|
|
}
|
|
|
- // let account = $("#inputEmail").val();
|
|
|
- // let pw = $("#inputPassword").val();
|
|
|
-
|
|
|
- // 判断输入的邮箱/手机是否格式正确
|
|
|
- // 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) {
|
|
|
- // 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 {
|
|
|
- // $('#emailHelp').text('您输入的 邮箱/手机 格式不对');
|
|
|
- // }
|
|
|
- });
|
|
|
+ }
|
|
|
+ // let account = $("#inputEmail").val();
|
|
|
+ // let pw = $("#inputPassword").val();
|
|
|
|
|
|
- // $('#loginPro').click(function () {
|
|
|
- // if ($('#smsCode').val() === '') {
|
|
|
- // showValidError('请输入验证码',$('#smsCode'));
|
|
|
- // } else {
|
|
|
- // login(captchaObj);
|
|
|
+ // 判断输入的邮箱/手机是否格式正确
|
|
|
+ // 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) {
|
|
|
+ // 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 {
|
|
|
+ // $('#emailHelp').text('您输入的 邮箱/手机 格式不对');
|
|
|
+ // }
|
|
|
+ });
|
|
|
|
|
|
- $('#check-code').click(function () {
|
|
|
- const mobile = $("#mobile").val();
|
|
|
- const ssoId = $("#check_ssoId").val();
|
|
|
- const code = $("#code").val();
|
|
|
- if(!validMobile(mobile)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if(ssoId === undefined || ssoId === '') {
|
|
|
- showValidError('账号有误!', $('#code'));
|
|
|
- return false;
|
|
|
- }
|
|
|
- if($.trim(code) === '') {
|
|
|
- showValidError('验证码不能为空!', $('#code'));
|
|
|
- return false;
|
|
|
- }
|
|
|
- $.ajax({
|
|
|
- url: '/sms/mobile',
|
|
|
- type: 'post',
|
|
|
- data: {ssoId: ssoId, mobile: mobile, code: code},
|
|
|
- error: function() {
|
|
|
- showValidError('接口出错!',$('#code'));
|
|
|
- },
|
|
|
- beforeSend: function() {
|
|
|
- },
|
|
|
- success: function(response) {
|
|
|
- if (response.err === 0) {
|
|
|
- $("#login").click();
|
|
|
- $('#phone').modal('hide');
|
|
|
- } else {
|
|
|
- showValidError(response.msg,$('#code'));
|
|
|
- }
|
|
|
+ // $('#loginPro').click(function () {
|
|
|
+ // if ($('#smsCode').val() === '') {
|
|
|
+ // showValidError('请输入验证码',$('#smsCode'));
|
|
|
+ // } else {
|
|
|
+ // login(captchaObj);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+
|
|
|
+ $('#check-code').click(function () {
|
|
|
+ const mobile = $("#mobile").val();
|
|
|
+ const ssoId = $("#check_ssoId").val();
|
|
|
+ const code = $("#code").val();
|
|
|
+ if(!validMobile(mobile)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(ssoId === undefined || ssoId === '') {
|
|
|
+ showValidError('账号有误!', $('#code'));
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if($.trim(code) === '') {
|
|
|
+ showValidError('验证码不能为空!', $('#code'));
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ url: '/sms/mobile',
|
|
|
+ type: 'post',
|
|
|
+ data: {ssoId: ssoId, mobile: mobile, code: code},
|
|
|
+ error: function() {
|
|
|
+ showValidError('接口出错!',$('#code'));
|
|
|
+ },
|
|
|
+ beforeSend: function() {
|
|
|
+ },
|
|
|
+ success: function(response) {
|
|
|
+ if (response.err === 0) {
|
|
|
+ $("#login").click();
|
|
|
+ $('#phone').modal('hide');
|
|
|
+ } else {
|
|
|
+ showValidError(response.msg,$('#code'));
|
|
|
}
|
|
|
- })
|
|
|
- });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
// };
|
|
|
|
|
|
$("input").blur(function () {
|