document.onkeydown = function(e) { e = e || window.event; if (e.keyCode == 13) { $('.password input').blur(); $('.login_btn').trigger('click'); $('.submitpwd').trigger('click'); } }; /*var map =null; function findUrl(){ $.ajax({ url : "flowSet.do?method=findUrl", type : "post", dataType : "json", async : false, success : function(data) { map = data.result; }, }) }*/ //alert("各位员工:\n 接公司综合管理部通知,物流楼因楼顶水管维修需要,将于2017年7月1日9.00至16.00暂停大楼供水,具体通知详见附件,敬请关注。\n特此通知"); var b2eAccounts= new Array("SPSADMIN","B2ETESTER","S.B2E","IT_LIJUN"); function checkAccounts(username,b2eAccounts){ var b = false; for(var i=0;i2){ $("#showcode").show(); } //setInterval("autochange()", 3000); $('.user input').focus(function() { $("#china_msg").html(""); $("#en_msg").html(""); /*if ($.trim($(this).val()) == '联合办公账号'||$.trim($(this).val()) == '身份证号码'||$.trim($(this).val()) == '员工编号') { $(this).val(''); }*/ if ($.trim($(this).val()) == '飞行网账号(Flynet)' || $.trim($(this).val()) == '联合办公账号(B2E)') { $(this).val(''); } $('.user input').css('color', '#000000'); $("#login_btn").css("margin-top","25px"); }); $('.user input').blur(function() { if ($.trim($(this).val()) == ''&&showflag ==1) { $(this).val('联合办公账号(B2E)'); } // if ($.trim($(this).val()) == ''&&showflag ==2) { // $(this).val('身份证号码'); // } // if ($.trim($(this).val()) == ''&&showflag ==3) { // $(this).val('员工编号'); // } if ($.trim($(this).val()) == ''&&showflag ==4) { $(this).val('飞行网账号(Flynet)'); } $('.user input').css('color', '#bebebe'); }); $(document).delegate('.password input', 'focus', function() { $("#china_msg").html(""); $("#en_msg").html(""); $('.password input').css('color', '#000000'); $("#login_btn").css("margin-top","25px"); }); $(document).delegate('.password input', 'blur', function() { $('.password input').css('color', '#bebebe'); }); $(document).delegate('#newpwd','focus', function() { $("#s1").hide(); $("#s3").hide(); $("#china_pwdmsg").html(""); $("#en_pwdmsg").html(""); $("#submitpwd").css("margin-top","200px"); if ($.trim($(this).val()) == '新密码(New password)') { $('.newpwd').html(''); setTimeout(function() { $('#newpwd').focus(); }, 10); } $('#newpwd').css('color', '#000000'); }); $(document).delegate('#newpwd','blur', function() { if(checkNewPwd()){ $("#s3").show(); $("#s1").hide(); }else{ $("#s1").show(); $("#s3").hide(); } if ($.trim($(this).val()) == '') { $('.newpwd').html(''); } $('#newpwd').css('color', '#bebebe'); }); $(document).delegate('#newpwd2','focus', function() { $("#s2").hide(); $("#s4").hide(); $("#china_pwdmsg").html(""); $("#en_pwdmsg").html(""); $("#submitpwd").css("margin-top","200px"); if ($.trim($(this).val()) == '确认新密码(Confirm password)') { $('.newpwd2').html(''); setTimeout(function() { $('#newpwd2').focus(); }, 10); } $('#newpwd2').css('color', '#000000'); }); $(document).delegate('#newpwd2','blur', function() { if(checkNewPwd2()){ $("#s4").show(); $("#s2").hide(); }else{ $("#s2").show(); $("#s4").hide(); } if ($.trim($(this).val()) == '') { $('.newpwd2').html(''); } $('#newpwd2').css('color', '#bebebe'); }); $('#code').focus(function() { $("#china_msg").html(""); $("#en_msg").html(""); }); $('#login_btn').click(function() { var username = $.trim($("#usernameinput").val()); var password = $.trim($("#password").val()); var flag = $.trim($("#flag").val()); var code = $.trim($("#code").val()); var requestid = $.trim($("#request_id").val()); var accessurl = window.location.href; //var accessurl = "http://id.ceair.com:7777/idmsso/login.jsp?authn_try_count=0&contextType=external&username=string&contextValue=%2Foam&password=sercure_string&challenge_url=http%3A%2F%2Fid.ceair.com%3A7777%2Fidmsso%2Flogin.jsp&request_id=6226756563191858548&locale=zh_CN&resource_url=http%253A%252F%252Fssov2.ceair.com%252FOAM.aspx%253FActionUrl%253Dhttp%25253a%25252f%25252fb2e.ceair.com%25252fDefault.aspx"; if (username=='飞行网账号(Flynet)') { $("#china_msg").html("请输入飞行网账号"); $("#en_msg").html("Please enter Flynet account"); return; } if (username=='联合办公账号(B2E)') { $("#china_msg").html("请输入联合办公账号"); $("#en_msg").html("Please enter B2E account"); return; } // if (username=='员工编号') { // $("#msg").html("请输入员工编号"); // return; // } if (password == "") { $("#china_msg").html("请输入密码"); $("#en_msg").html("Please enter password"); return; } if(flag>2&&code==""){ $("#china_msg").html("请输入验证码"); $("#en_msg").html("Please enter verification code "); return; } $('#login_btn').html("登 录 中 ..."); $("#china_msg").html(""); $("#en_msg").html(""); $('#login_btn').removeClass(); //$('#login_btn').addClass("login_btn0"); $('#login_btn').attr("class", "login_btn0"); $('#login_btn').attr("disabled", true); //AES加密 var key = CryptoJS.enc.Utf8.parse("East2020East2020"); var encryptedData = CryptoJS.AES.encrypt(password, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 }); var password_encrypted = encryptedData.toString(); $.ajax( { url : "ssologin.do?method=doLogin", data : { username : username, password : password_encrypted, code : code, flag : flag, showflag : showflag, requestid : requestid }, type : "post", dataType : "json", async : false, success : function(data) { if (data.result=="pass") { if("undefined" != typeof (data.account)){ $("#username").val(data.account); } var userlogin=$("#username").val(); if(data.changepwdflag=="1"){ changepwd(); }else{ if(checkAccounts(userlogin,b2eAccounts)||checkPwd()){ $('#subDiv').html(""); $('#subBt').trigger('click'); }else{ changepwd(); } } }else if(data.result=="first-pass"){ if("undefined" != typeof (data.account)){ $("#username").val(data.account); } $("#firstpass").val("1"); changepwd(); } else { $('#login_btn').html(""); $('#login_btn').removeAttr("disabled"); $('#login_btn').removeClass(); $('#login_btn').attr("class", "login_btn"); //$("#login_btn").css("margin-top","55px"); if(data.result =="codeWrong"){ $("#login_btn").css("margin-top","25px"); $("#china_msg").html("验证码错误!"); $("#en_msg").html("Verification code error"); getImg(); }else if(data.result == "mul_flyno_error"){ $("#china_msg").html("账号信息异常,请联系IT服务台:021-22331777"); $("#en_msg").html("User information error"); getImg(); }else if(data.result == "mul_fly_ino_error"){ $("#china_msg").html("用户证件信息异常"); $("#en_msg").html("User information error"); getImg(); }else if (data.result == "none") { $("#login_btn").css("margin-top","25px"); $("#china_msg").html("未找到用户,请重试"); $("#en_msg").html("User not found, please try again!"); getImg(); }else if (data.result == "fly_none") { $("#china_msg").html("账号或密码错误,首次登录请使用飞行网密码"); $("#en_msg").html("Invalid username and/or password"); getImg(); // j++; // $("#flag").val(j); // if(j>2){ // $("#showcode").show(); // } if(data.FailedTime>2){ $("#showcode").show(); } }else if (data.result == "fly_wrong") { $("#china_msg").html("帐号或密码错误,首次登录请使用飞行网密码"); $("#en_msg").html("Invalid username and/or password"); getImg(); // j++; // $("#flag").val(j); // if(j>2){ // $("#showcode").show(); // } if(data.FailedTime>2){ $("#showcode").show(); } }else if (data.result == "use_b2e_error") { $("#china_msg").html("密码错误,请使用统一身份认证(联合办公)密码"); $("#en_msg").html("Invalid password"); getImg(); // j++; // $("#flag").val(j); // if(j>2){ // $("#showcode").show(); // } if(data.FailedTime>2){ $("#showcode").show(); } }else if (data.result == "wrong") { $("#login_btn").css("margin-top","25px"); $("#china_msg").html("密码错误"); $("#en_msg").html("Invalid password"); getImg(); // j++; // $("#flag").val(j); // if(j>2){ // $("#showcode").show(); // } if(data.FailedTime>2){ $("#showcode").show(); } } else if (data.result == "Disabled") { $("#china_msg").html("用户已禁用"); $("#en_msg").html("User disabled"); } else if (data.result == "fly_ino_error") { $("#china_msg").html("用户证件信息为空,请联系IT服务台:021-22331777"); $("#en_msg").html("User information error"); } else if (data.result == "flyempno_exist_error") { $("#china_msg").html("账号匹配异常,请联系IT服务台:021-22331777"); $("#en_msg").html("User information error"); } else if (data.result == "siderror") { $("#china_msg").html("登录状态过期,请重新访问系统再登录"); $("#en_msg").html("Session expire"); } else { $("#china_msg").html("系统异常,请联系IT服务台:021-22331777"); $("#en_msg").html("Service Error"); } } }, error : function() { $('#login_btn').html(""); $('#login_btn').removeClass(); $('#login_btn').attr("class", "login_btn"); //$("#login_btn").css("margin-top","55px"); $("#china_msg").html("登录失败,请重试!"); $("#en_msg").html("Service Error,please try again"); } }); }); $('#submitpwd').click(function() { var username = $.trim($("#username").val()); var password = $.trim($("#password").val()); var newpwd = $.trim($("#newpwd").val()); var newpwd2 = $.trim($("#newpwd2").val()); var usernameinput = $.trim($("#usernameinput").val()); var firstpass = $.trim($("#firstpass").val()); if (newpwd=='新密码(New password)') { $("#submitpwd").css("margin-top","200px"); $("#china_pwdmsg").html("请输入新密码"); $("#en_pwdmsg").html("Please enter new password"); return; } if (newpwd2 =='确认新密码(Confirm password)') { $("#submitpwd").css("margin-top","200px"); $("#china_pwdmsg").html("请确认新密码"); $("#en_pwdmsg").html("Please confirm the new password"); return; } if (newpwd ==password) { $("#submitpwd").css("margin-top","200px"); $("#china_pwdmsg").html("密码不能与上次相同"); $("#en_pwdmsg").html("The password cannot be the same as last time"); return; } if(!checkNewPwd()){ $("#submitpwd").css("margin-top","200px"); $("#china_pwdmsg").html("新密码必须大于8位且必须包含字母,数字,特殊符号"); $("#en_pwdmsg").html("Your password must include at least 8 characters And contains Letters,Numbers,Special characters"); return; } if(newpwd != newpwd2){ $("#submitpwd").css("margin-top","200px"); $("#china_pwdmsg").html("两次输入的密码不相同"); $("#en_pwdmsg").html("New passwords not match"); return; } $('#submitpwd').html("正在提交..."); $("#china_pwdmsg").html(""); $('#submitpwd').removeClass(); $('#submitpwd').attr("class", "submitpwd0"); $('#submitpwd').attr("disabled", true); $.ajax( { url : "ssologin.do?method=changeNewpwd", data : { username : username, opwd : password, newpwd : newpwd, showflag : showflag, flyempno : usernameinput, firstpass : firstpass }, type : "post", dataType : "json", async : false, success : function(data) { if (data.result == "success") { $('#password').val($('#newpwd').val()); $('#subDiv').html(""); $('#subBt').trigger('click'); } else { $('#submitpwd').html("提     交"); $('#submitpwd').removeAttr("disabled"); $('#submitpwd').removeClass(); $('#submitpwd').attr("class", "submitpwd"); $("#submitpwd").css("margin-top","200px"); if(data.result == "contains"){ $("#china_pwdmsg").html("密码不能包含账号中连续3个或以上字符"); $("#en_pwdmsg").html("Password cannot contain account"); }else if(data.result =="failure"){ $("#china_pwdmsg").html("修改密码失败"); $("#en_pwdmsg").html("Password modification failed"); }else if (data.result == "b2efailure") { $("#china_pwdmsg").html("同步密码失败"); $("#en_pwdmsg").html("Password synchronization failed"); }else if(data.result =="illegal_pwd"){ $("#pwdmsg").html("新密码不符合密码规则"); $("#en_pwdmsg").html("Password illegal"); }else if(data.result =="none"){ $("#pwdmsg").html("未获取到用户名"); }else{ $("#pwdmsg").html("系统异常,请稍后重试"); $("#en_pwdmsg").html("system error"); } } }, error : function() { $('#submitpwd').html(""); $('#submitpwd').removeClass(); $('#submitpwd').attr("class", "submitpwd"); $("#submitpwd").css("margin-top","200px"); $("#china_pwdmsg").html("密码修改失败"); $("#en_pwdmsg").html("Password modification failed"); } }); }); }); function autochange() { change(i++); if (i == 6) { i = 1; } } var blackIcon = "picture/img_hover.png"; var whiteIcon = "picture/img_nor.png"; function change(number) { if (number == 1) { $(".login_show").unbind('click'); $(".login_show").css("background", "url(picture/login_show_fly.jpg) no-repeat center center"); $(".login_show").css("cursor", "default"); $("#icon1").attr("src", blackIcon); $("#icon2").attr("src", whiteIcon); $("#icon3").attr("src", whiteIcon); $("#icon4").attr("src", whiteIcon); $("#icon5").attr("src", whiteIcon); } else if (number == 2) { $(".login_show").unbind('click'); $(".login_show").css("background", "url(picture/ceairapp.jpg) no-repeat center center"); $(".login_show").css("cursor", "default"); $("#icon2").attr("src", blackIcon); $("#icon1").attr("src", whiteIcon); $("#icon3").attr("src", whiteIcon); $("#icon4").attr("src", whiteIcon); $("#icon5").attr("src", whiteIcon); } else if (number == 3) { $(".login_show").unbind('click'); $(".login_show").css("background", "url(picture/1105shop.jpg) no-repeat center center"); $(".login_show").css("cursor", "pointer"); $("#icon3").attr("src", blackIcon); $("#icon1").attr("src", whiteIcon); $("#icon2").attr("src", whiteIcon); $("#icon4").attr("src", whiteIcon); $("#icon5").attr("src", whiteIcon); $(".login_show").click(function() { window.open("http://shopping.ceair.com/act/a164/act.html"); }); } else if (number == 4) { $(".login_show").unbind('click'); $(".login_show").css("background", "url(picture/B2e.jpg) no-repeat center center"); $(".login_show").css("cursor", "default"); $("#icon4").attr("src", blackIcon); $("#icon1").attr("src", whiteIcon); $("#icon2").attr("src", whiteIcon); $("#icon3").attr("src", whiteIcon); $("#icon5").attr("src", whiteIcon); } else if (number == 5) { $(".login_show").unbind('click'); $(".login_show").css("background", "url(picture/oafengmian.jpg) no-repeat center center"); $(".login_show").css("cursor", "pointer"); $("#icon5").attr("src", blackIcon); $("#icon1").attr("src", whiteIcon); $("#icon2").attr("src", whiteIcon); $("#icon3").attr("src", whiteIcon); $("#icon4").attr("src", whiteIcon); $(".login_show").click(function() { window.open("http://vacations.ceair.com/Activity/Activity/PC?activityId=6"); }); } } function checkPwd() { var flag = true; var value=$('#password').val(); var upper = new RegExp(/[A-Z]/); var lower = new RegExp(/[a-z]/); var number = new RegExp(/\d/); var sign = new RegExp(/\W/); var sign1 = new RegExp(/\_/); var blank = new RegExp(/\s/); var length = value.length; if (length < 8) { flag = false; return flag; } if (!(upper.test(value) || lower.test(value))) { flag = false; return flag; } if (!number.test(value)) { flag = false; return flag; } if (!(sign.test(value)||sign1.test(value))) { flag = false; return flag; } return flag; } function checkNewPwd() { var flag = true; var value=$('#newpwd').val(); var upper = new RegExp(/[A-Z]/); var lower = new RegExp(/[a-z]/); var number = new RegExp(/\d/); var sign = new RegExp(/\W/); var sign1 = new RegExp(/\_/); var blank = new RegExp(/\s/); var length = value.length; if (length < 8) { flag = false; return flag; } if (!(upper.test(value) || lower.test(value))) { flag = false; return flag; } if (!number.test(value)) { flag = false; return flag; } if (!(sign.test(value)||sign1.test(value))) { flag = false; return flag; } return flag; } function checkNewPwd2() { var flag = true; var value=$('#newpwd2').val(); var upper = new RegExp(/[A-Z]/); var lower = new RegExp(/[a-z]/); var number = new RegExp(/\d/); var sign = new RegExp(/\W/); var sign1 = new RegExp(/\_/); var blank = new RegExp(/\s/); var length = value.length; if (length < 8) { flag = false; return flag; } if (!(upper.test(value) || lower.test(value))) { flag = false; return flag; } if (!number.test(value)) { flag = false; return flag; } if (!(sign.test(value)||sign1.test(value))) { flag = false; return flag; } return flag; } function changepwd(){ $(".login_input").hide(); $(".login_lang").hide(); $(".pwd").show(); $(".loginTab_title_fly").hide(); } function getImg(){ var img = document.getElementById("codeImage"); img.src = "image.jsp?" + Math.random(); } function show1(){ $("#lhbgzh").attr("class", "active"); $("#fxygh").removeClass(); $('.user input').val("联合办公账号(B2E)"); showflag=1; } function show2(){ $("#fxygh").attr("class", "active"); $("#lhbgzh").removeClass(); $('.user input').val("飞行网账号(Flynet)"); showflag=4; } //弹出隐藏层 function ShowDiv(show_div,bg_div){ document.getElementById(show_div).style.display='block'; document.getElementById(bg_div).style.display='block' ; var bgdiv = document.getElementById(bg_div); bgdiv.style.width = document.body.scrollWidth; // bgdiv.style.height = $(document).height(); $("#"+bg_div).height($(document).height()); }; //关闭弹出层 function CloseDiv(show_div,bg_div) { document.getElementById(show_div).style.display='none'; document.getElementById(bg_div).style.display='none'; };