ge.js")); return false; } if ($.trim(vcode) == "") { $("#vcode").focus(); $("#errorMsg").text("验证码不能为空!"); $("#errorMsg").trigger($.Event("change.js")); return false; } $.ajax({ url: "/usckDigit = $("input[name='checkDigit']").val(); //验证码 var userName = $("#userName").val(); //账号 var password = $("#password").val(); //密码 if ($.trim(userName) == "") { $("#userName").focus(); $("#errorMsg").text("账号不能为空!"); $("#errorMsg").trigger($.Event("change.js")); return false; } if ($.trim(password) == "") { $("#password").focus(); $("#errorMsg").text("密码不能为空!"); $("#errorMsg").trigger($.Event("change.js")); return false; } var randomString = generateRandomString(6); var newPass = btoa(password); $("#password").val(randomString+newPass); var dataPara = $("form[name='loginForm']").serialize() + "&time=" + new Date().getTime(); $.ajax({ url: "/userAction!do_login.action", type: "post", data: dataPara, dataType: "json", async: false, success: ajaxCallBackFn }); } function generateRandomString(length) { const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; let result = ''; const charactersLength = characters.length; for (let i = 0; i < length; i++) { const randomIndex = Math.floor(Math.random() * charactersLength); result += characters.charAt(randomIndex); } return result; } /** * 手机验证码登录 */ function ajaxSubmitPhoneForm() { var phone = $("#phone").val(); //账号 var vcode = $("#vcode").val(); //密码 if ($.trim(phone) == "") { $("#phone").focus(); $("#errorMsg").text("手机号不能为空!"); $("#errorMsg").trigger($.Event("change.js")); return false; } if ($.trim(phone).length != 11) { $("#phone").focus(); $("#errorMsg").text("手机号填写不正确!"); $("#errorMsg").trigger($.Event("change.js")); return false; } if ($.trim(vcode) == "") { $("#vcode").focus(); $("#errorMsg").text("验证码不能为空!"); $("#errorMsg").trigger($.Event("change.js")); return false; } $.ajax({ url: "/userAction!do_loginByPhone.action", type: "post", data: {"phone":phone,"vcode":vcode}, dataType: "json", async: false, success: ajaxCallBackFn }); } function ajaxCallBackFn(msg){ if (msg.status == "loginSuccess") {//登录成功 $("#login").attr("action", msg.path); $("#login").submit(); } else { if (msg.status == "needdigit") { showCheckDigit(); placeholder4IE(); $("input[name='checkDigit']").focus(); $("#errorMsg").text("请输入验证码!"); $("#errorMsg").trigger($.Event("change.js")); } else if (msg.status == "wrongpassword") {//密码错误 var remainTimes = msg.remainTimes; $("input[name='entity.password']").focus().val(""); refleshCheckCode(); if (remainTimes <= 2) { $("#errorMsg").text("您输入的密码有误,还有"+ remainTimes +"次机会!"); } else { $("#errorMsg").text("用户名或密码错误!"); } showCheckDigit(); placeholder4IE(); } else if(msg.status == "errorpassword") {//密码错误 $("input[name='entity.password']").focus().val(""); refleshCheckCode(); $("#errorMsg").text("您输入的密码有误!"); showCheckDigit(); placeholder4IE(); } else if(msg.status == "noaccount") {//账号不存在 $("input[name='entity.account']").focus().val(""); refleshCheckCode(); $("#errorMsg").text("您输入的用户名不存在!"); $("input[name='entity.password']").val(""); showCheckDigit(); placeholder4IE(); } else if(msg.status == "wrongCheckDigit"){ $("input[name='checkDigit']").focus().val(""); refleshCheckCode(); $("#errorMsg").text("验证码有误,请重新输入!"); } else if(msg.status == "unEffectCheckDigit"){ $("input[name='checkDigit']").focus().val(""); refleshCheckCode(); $("#errorMsg").text("验证码已失效,请重新获取!"); } else if(msg.status == "notExpert") {//不是专家不能用专家身份登录 $("#errorMsg").text("您不是专家不能用专家身份登录!"); } else if(msg.status == "expertNotNormal") {//您是评审专家不能用科研人员身份登录系统 $("#errorMsg").text("您是专家不能用科研人员身份登录!"); } else if(msg.status == "accountForbid" || msg.status == "accountHaveForbid") {//禁用状态 $("div .username").css("margin-top","23px");//防止提示文字覆盖账号输入框 $("#errorMsg").text(msg.remainTime); } else if (msg.status == "unuse") { $("#errorMsg").text("您的账号未启用,请联系管理员!"); } else if (msg.status == "defGroupError") { $("#errorMsg").text("您的账号未设置默认登录角色,请联系管理员!"); } else if (msg.status == "nophone") { $("#errorMsg").text("您输入的手机号不存在!"); } else if (msg.status == "erroraccountpassword") { $("#errorMsg").text("用户名或密码错误!"); refleshCheckCode(); } else { $("#errorMsg").text(msg.status); } $("#errorMsg").trigger($.Event("change.js")); } } $(function() { if(isDemoMode == 'true'){//演示模式下,默认是短信登录 changeLogin("phoneLogin"); } placeholder4IE(); var bodyWidth = document.body.clientWidth; $("*[name='entity\\.bodyWidth']").val(bodyWidth); if (window.parent != window) { parent.window.location.href = "/index.html"; return; } $("input[name='entity\\.account']").focus(); $("input[name='entity.account']").val(getCookie("account")); $("input[name='entity.password']").val(getCookie("password")); //当手机号输入框内容改变时,需要清空错误信息 $("#phone").bind('input propertychange', function() { $("#errorMsg").text(""); }); //当用户名内容改变时,重置发送短信按钮 $("#userName").bind('input propertychange', function() { $("#sendMessage").removeAttr("disabled").val("点击获取"); wait = 30; $("#errorMsg").text(""); }); /* $("#errorMsg").on("change.js", function(){//使文字始终保持垂直居中 $(this).css("lineHeight", "40px"); if ($(this).height() > 42) { $(this).css("lineHeight", "normal"); } else if ($(this).height() < 42) { $(this).css("lineHeight", "40px"); } }); */ $("#weixin").powerFloat({ eventType: "hover", targetMode: null, target: $("#weixinQrCode"), position: "7-5" }); $("#app").powerFloat({ eventType: "hover", targetMode: null, target: $("#appQrCode"), position: "7-5" }); }); function submitForm() { if(confirm()){ if (document.loginForm.password.value.length != 32) { document.loginForm.password.value=calcMD5(document.loginForm.password.value); } document.loginForm.actionType.value = "login"; document.loginForm.submit(); } } function reset(){ document.loginForm.reset(); document.loginForm.account.focus(); } function changeUserType() { var userType = document.loginForm.userType.value; if (userType == "2") { document.all.school.style.display = ""; } else { document.all.school.style.display="none"; } } function judge(){ var event=arguments.callee.caller.arguments[0]||window.event;//消除浏览器差异 if (event.keyCode == 13) { if($("#loginByAccount").css("display") == 'none'){//判断当前是账号登录还是短信登录 ajaxSubmitPhoneForm(); }else{ ajaxSubmitForm(); } } } //刷新页面验证码 function refleshCheckCode() { document.getElementById("checkCode").src = "picCheck?timeStamp=" + new Date().getTime(); } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=[]; var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i
0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i
武汉大学人文社会科学研究管理系统
统一身份认证登录
账号密码登录
科研人员
评审专家
登录
返回
登录
电话: 400-800-1636
邮箱: support@e-plugger.com