| | |
| | | <!-- 用户名 --> |
| | | <div class="loginid" style='width: 400px; margin-right: 50px; margin-top: 45px; border-bottom: 1px solid #fff;'> |
| | | <label for="username"></label> |
| | | <input class="required" id="username" placeholder="请输入用户名" size="25" tabindex="1" |
| | | <input class="required" id="username" placeholder="请输入用户名" size="20" tabindex="1" |
| | | type="text" accesskey="n" autocomplete="off" name="username" value="" /> |
| | | </div> |
| | | <!-- 密码 --> |
| | | <section> |
| | | <div class="loginpwd" style='width: 400px; margin-right: 20px; margin-top: 30px; border-bottom: 1px solid #fff;'> |
| | | <label for="password"></label> |
| | | <input class="required" placeholder="请输入密码" type="password" id="password" size="25" tabindex="2" |
| | | <input class="required" placeholder="请输入密码" type="password" id="password" size="20" tabindex="2" |
| | | accesskey="p" autocomplete="off" name="password" value="" /><span id="capslock-on" style="display: none;"> |
| | | <i class="fa fa-exclamation-circle"></i> |
| | | <span>CAPSLOCK key is turned on!</span> |
| | |
| | | |
| | | function autoResize() { |
| | | var div_obj = document.getElementById("div_middle"); |
| | | // 宽度自适应 |
| | | //宽度自适应 |
| | | var fullWidth = document.body.offsetWidth; |
| | | var div_loginBox = document.getElementById("div_loginBox"); |
| | | var boxWidth = div_loginBox.offsetWidth; |
| | |
| | | //if (fullWidth > 1920) { fullWidth = 1920; } |
| | | |
| | | var winWidht = window.innerWidth; |
| | | var winHeight = window.innerHeight + 50; |
| | | var winHeight = window.innerHeight - 100; |
| | | var bgHeight = 1080; |
| | | winWidht += 150; |
| | | if (winWidht >= 1920) { |
| | | $("#div_middle").css("background", "url(../images/NewGJXJlogin/1920/2bg.jpg) no-repeat").css("background-position", "center bottom").css("height", "800px"); |
| | | $("#div_middle").css("height", "980px"); |
| | |
| | | $(".loginvalifield").css("margin-top", "20px").css("width", "350px").css("height", "45px"); |
| | | $("#inputCode").css("margin-left", "46px"); |
| | | $(".logintable").css("margin-top", "113px").css("width", "350px").css("height", "470px"); |
| | | //$(".logintable").css("margin-top", "210px").css("width", "350px").css("height", "470px"); |
| | | $("#carLink div").css("background", "url(../images/NewGJXJlogin/1600/add.png) no-repeat").css("background-position", "3% 40%"); |
| | | $("#carLink a").css("margin-left", "50px").css("font-size", "16px"); |
| | | $(".loginbtn").css("margin-top", "25px"); |
| | | leftoffset = 404; |
| | | bgHeight = 800; |
| | | bgHeight = 800; //900 |
| | | div_loginBox.style.left = ((fullWidth - 360) / 2 + leftoffset) + "px"; |
| | | } else if (winWidht >= 1440) { |
| | | $("#div_middle").css("background", "url(../images/NewGJXJlogin/1440/2bg.jpg) no-repeat").css("background-position", "center bottom").css("height", "810px"); |
| | |
| | | $(".loginvalicode input").css("width", "165px").css("margin-left", "46px").css("font-size", "14px"); |
| | | $(".loginvalifield").css("margin-top", "20px").css("width", "300px").css("height", "40px"); |
| | | $(".logintable").css("margin-top", "83px").css("width", "300px").css("height", "390px"); |
| | | //$(".logintable").css("margin-top", "135px").css("width", "300px").css("height", "390px"); |
| | | $("#carLink div").css("background", "url(../images/NewGJXJlogin/1366/add.png) no-repeat").css("background-position", "3.5% 50%").css("margin-top", "25px").css("height", "30px").css("line-height", "30px"); |
| | | $("#carLink a").css("margin-left", "50px").css("font-size", "14px"); |
| | | $(".loginbtn").css("margin-top", "10px").css("height", "56px"); |
| | | leftoffset = 338; |
| | | bgHeight = 668; |
| | | bgHeight = 668; //731 |
| | | div_loginBox.style.left = ((fullWidth - 300) / 2 + leftoffset) + "px"; |
| | | } else { |
| | | //fullWidth = 1280; |
| | | $("#div_middle").css("background", "url(../images/NewGJXJlogin/1280/2bg.jpg) no-repeat").css("background-position", "center bottom").css("height", "620px"); |
| | | $("#loginBox_Title").css("height", "50px").css("line-height", "50px"); |
| | | $("#loginBox_Title span").css("font-size", "32px"); |
| | |
| | | $("body").css("overflow", "hidden"); |
| | | } |
| | | div_obj.style.width = fullWidth + "px"; |
| | | |
| | | if (winHeight > bgHeight) { |
| | | div_obj.style.height = winHeight + "px"; |
| | | var marginTop = parseFloat($(".logintable").css("margin-top").replace("px")) + (winHeight - bgHeight); |
| | | $(".logintable").css("margin-top", marginTop + "px"); |
| | | } |
| | | |
| | | // 高度自适应 |
| | | //高度自适应 |
| | | var fullHeight = document.body.offsetHeight; |
| | | var myHeight = div_obj.offsetHeight; |
| | | if (fullHeight > myHeight) { |
| | |
| | | noIframe(); |
| | | createCode(); |
| | | autoResize(); |
| | | getPublicKey(); |
| | | $(window).on("resize", autoResize); |
| | | document.getElementById('username').focus(); |
| | | } |
| | | </script> |
| | | <script> |
| | | function getPublicKey() { |
| | | $.get("getPublicKey", function (rs) { |
| | | if (rs && rs.code == 200) { |
| | | window.encrypt = new JSEncrypt(); |
| | | encrypt.setPublicKey(rs.result); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function sysValidate() { |
| | | // 验证用户名与密码 |
| | | var theUsername = document.getElementById("username").value; |
| | |
| | | $("#password").focus(); |
| | | return false; |
| | | } |
| | | /*if (!isValid(thePassword)) { |
| | | $("#eMsg").html("提示:密码为8-20位包含字母、数字和特殊字符!"); |
| | | $("#password").focus(); |
| | | return false; |
| | | }*/ |
| | | |
| | | // 验证验证码 |
| | | var inputCode = document.getElementById("inputCode").value; |
| | | if (inputCode.length <= 0) { |
| | |
| | | var service = getQueryStr("service"); |
| | | |
| | | var data = { |
| | | "uid": username, |
| | | "pwd": password |
| | | "uid": encrypt.encrypt(username), |
| | | "pwd": encrypt.encrypt(password) |
| | | }; |
| | | |
| | | $.ajax({ |
| | |
| | | sysLogin(); |
| | | } |
| | | } |
| | | |
| | | // 密码是否合规 |
| | | function isValid(pwd) { |
| | | if (pwd) { |
| | | var regex = new RegExp('^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\W!@#$%^&*`~()\\-_+=,.?;<>]{16,30}$'); |
| | | return regex.test(pwd) |
| | | } |
| | | return false; |
| | | } |
| | | </script> |
| | | </body> |
| | | </html> |