| | |
| | | <!-- 用户名 --> |
| | | <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> |
| | |
| | | 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> |