101ca40818525ff6e9dd11570225b931c658102e.svn-base 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%
  3. String path = request.getContextPath();
  4. %>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  9. <title>QUI网页界面集成框架JAVA示例版</title>
  10. <link href="<%=path%>/system/login/skin/style.css" rel="stylesheet" type="text/css" id="skin"/>
  11. <script type="text/javascript" src="<%=path%>/libs/js/jquery.js"></script>
  12. <script type="text/javascript" src="<%=path%>/libs/js/login.js"></script>
  13. <!--居中显示start-->
  14. <script type="text/javascript" src="<%=path%>/libs/js/method/center-plugin.js"></script>
  15. <!--居中显示end-->
  16. <style>
  17. /*提示信息*/
  18. #cursorMessageDiv {
  19. position: absolute;
  20. z-index: 99999;
  21. border: solid 1px #cc9933;
  22. background: #ffffcc;
  23. padding: 2px;
  24. margin: 0px;
  25. display: none;
  26. line-height:150%;
  27. }
  28. /*提示信息*/
  29. </style>
  30. </head>
  31. <body >
  32. <div class="login_main">
  33. <div class="login_top">
  34. </div>
  35. <div class="login_middle">
  36. <div class="login_middleleft"></div>
  37. <div class="login_middlecenter">
  38. <form id="loginForm" action="login.do" class="login_form" method="post">
  39. <div class="login_user"><input type="text" id="username"></div>
  40. <div class="login_pass"><input type="password" id="password"></div>
  41. <div class="clear"></div>
  42. <div class="login_button">
  43. <div class="login_button_left"><input type="button" onclick="login()"/></div>
  44. <div class="login_button_right"><input type="reset" value=""/></div>
  45. <div class="clear"></div>
  46. </div>
  47. </form>
  48. <div class="login_info" style="display:none;"></div>
  49. <div class="login_info2">&nbsp;&nbsp;测试用户名:guest 密码:123456</div>
  50. </div>
  51. <div class="login_middleright"></div>
  52. <div class="clear"></div>
  53. </div>
  54. <div class="login_bottom">
  55. <div class="login_copyright">版权所有:http://www.quickui.net</div>
  56. </div>
  57. </div>
  58. <script>
  59. $(function(){
  60. //居中
  61. $('.login_main').center();
  62. document.getElementById("username").focus();
  63. $("#username").keydown(function(event){
  64. if(event.keyCode==13){
  65. login()
  66. }
  67. })
  68. $("#password").keydown(function(event){
  69. if(event.keyCode==13){
  70. login()
  71. }
  72. })
  73. })
  74. //登录
  75. function login() {
  76. var errorMsg = "";
  77. var loginName = document.getElementById("username");
  78. var password = document.getElementById("password");
  79. if(!loginName.value){
  80. errorMsg += "&nbsp;&nbsp;用户名不能为空!";
  81. }
  82. if(!password.value){
  83. errorMsg += "&nbsp;&nbsp;密码不能为空!";
  84. }
  85. if(errorMsg != ""){
  86. $(".login_info").html(errorMsg);
  87. $(".login_info").show();
  88. }
  89. else{
  90. $(".login_info").show();
  91. $(".login_info").html("&nbsp;&nbsp;正在登录中...");
  92. //登录处理
  93. $.post("<%=path%>/login.action",
  94. {"userinfor.userLoginName":loginName.value,"userinfor.userPassword":password.value},
  95. function(result){
  96. if(result == null){
  97. $(".login_info").html("&nbsp;&nbsp;登陆失败!");
  98. return false;
  99. }
  100. if(result.status=="true"||result.status==true){
  101. $(".login_info").html("&nbsp;&nbsp;登录成功,正在转到主页...");
  102. window.location="<%=path%>/system/layout/main.jsp";
  103. }
  104. else{
  105. $(".login_info").html("&nbsp;&nbsp;"+result.message);
  106. }
  107. },"json");
  108. }
  109. }
  110. </script>
  111. </body>
  112. </html>