| | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/js/tools/md5.js"></script> |
| | | <script type="text/javascript"> |
| | | |
| | | document.onkeydown = function(e) { |
| | | //捕捉回车事件 |
| | | var ev = (typeof event!= 'undefined') ? window.event : e; |
| | | if(ev.keyCode === 13 && document.activeElement.id === "key") { |
| | | login() |
| | | } |
| | | } |
| | | document.onkeyup = function (e) { |
| | | if (window.event)//如果window.event对象存在,就以此事件对象为准 |
| | | e = window.event; |
| | | var code = e.charCode || e.keyCode; |
| | | if (code === 13) { |
| | | login() |
| | | } |
| | | } |
| | | function login(){ |
| | | httpRequest({ |
| | | httpUrl: baseUrl+"/login.action", |
| | |
| | | password: hex_md5(document.getElementById('password').value) |
| | | } |
| | | }, function (res) { |
| | | window.location.href = "index.html"; |
| | | if (res.code === 200) { |
| | | window.location.href = "index.html"; |
| | | } else { |
| | | alert(res.msg); |
| | | } |
| | | |
| | | }) |
| | | } |
| | | |