index2.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=8">
  6. <title>南方电网应急指挥系统--登录</title>
  7. <link rel="Shortcut Icon" href="images/favicon.png"/><!--
  8. <link href="skin_flat/style.css" rel="stylesheet" type="text/css" id="skin"/> -->
  9. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
  10. <script type="text/javascript" src="/nwyj/scripts/freamwork/com/sinosoft/system/md5/md5.js"></script>
  11. <style>
  12. body{
  13. margin:0;
  14. padding:0;
  15. width:100%;
  16. height:100%;
  17. background-color: #e5e9ec;
  18. }
  19. .login_main{
  20. background-image: url("/nwyj/images/index/loginPage_bg1.jpg");
  21. background-position: 0px;
  22. height: 545px;
  23. width:1366px;
  24. margin:0;
  25. padding:0;
  26. position: relative;
  27. background-repeat: no-repeat;
  28. }
  29. .login_form {
  30. position: absolute;
  31. top: 185px;
  32. left: 839px;
  33. width: 270px;
  34. }
  35. div.login_user,div.login_pass{
  36. margin-bottom: 20px;
  37. }
  38. div.login_user{
  39. margin-left: 10px;
  40. border: 0;
  41. background-image: url("/nwyj/images/index/login_user1.png");
  42. background-position: 0px;
  43. background-repeat: no-repeat;
  44. background-position: 0 50%;
  45. _background-position: 0 40%;
  46. padding: 0 5px 0 26px;
  47. white-space:nowrap;
  48. word-break: keep-all;
  49. word-wrap: normal;
  50. }
  51. div.login_pass{
  52. margin-left: 10px;
  53. border: 0;
  54. background-image: url("/nwyj/images/index/login_pass.png");
  55. background-position: 0px;
  56. background-repeat: no-repeat;
  57. background-position: 0 50%;
  58. _background-position: 0 40%;
  59. padding: 0 5px 0 26px;
  60. white-space:nowrap;
  61. word-break: keep-all;
  62. word-wrap: normal;
  63. }
  64. input#username,input#password{
  65. height:35px;
  66. border-style: none;
  67. width: 210px;
  68. margin-left: 15px;
  69. font-size: 18px;
  70. line-height: 35px;
  71. background-color: transparent;
  72. border: 0;
  73. outline: none;
  74. }
  75. .login_button{
  76. margin-top: 30px;
  77. }
  78. .login_button_login{
  79. cursor:pointer;
  80. border: 0;
  81. background-image: url("/nwyj/images/index/login_login.png");
  82. background-position: 0px;
  83. background-repeat: no-repeat;
  84. background-position: 3px 50%;
  85. _background-position: 0 40%;
  86. padding: 0px;
  87. white-space:nowrap;
  88. word-break: keep-all;
  89. word-wrap: normal;
  90. height: 30px;
  91. display: inline-block;
  92. margin-left: 30px;
  93. }
  94. .login_button{
  95. text-align: center;
  96. width:100%;
  97. padding: 5% 0px 0px 3%;
  98. width: 97%;
  99. }
  100. .login_button_position{
  101. margin: 0px auto;
  102. cursor:pointer;
  103. border: 0px;
  104. display: inline-block;
  105. width:100%;
  106. }
  107. .login_info{
  108. margin-top: 30px;
  109. font-size: 12px;
  110. }
  111. </style>
  112. </head>
  113. <body >
  114. <div class="login_main">
  115. <div class="login_form">
  116. <div class="login_user"><input type="text" id="username" onkeyup="clearpassword()" watermark=" 用 户 名 " value=""></div>
  117. <div class="login_pass"><input type="password" id="password" watermark=" 密 码 " value=""></div>
  118. <div class="login_button">
  119. <div class="login_button_login login_button_position" onclick="login()" ></div>
  120. </div>
  121. <div class="login_info" style="display:none;"></div>
  122. </div>
  123. </div>
  124. <script type="text/javascript" >
  125. //帐号输入框变动时,清空密码框(2015.10.13 梁俊鹏)
  126. function clearpassword(){
  127. var _username = $("#username").val();
  128. $("#password").val("");
  129. }
  130. $(function(){
  131. //防止iframe内出现登录页
  132. if (window != top)
  133. top.location.href = location.href;
  134. //居中
  135. document.getElementById("username").focus();
  136. $("#username").keydown(function(event){
  137. if(event.keyCode==13){
  138. login();
  139. }
  140. })
  141. $("#password").keydown(function(event){
  142. if(event.keyCode==13){
  143. login();
  144. }
  145. })
  146. })
  147. //登录
  148. function login() {
  149. var errorMsg = "";
  150. var loginName =document.getElementById("username");
  151. var password = document.getElementById("password");
  152. var pasFormat=true;
  153. if(!loginName.value){
  154. errorMsg += "&nbsp;&nbsp;用户名不能为空!";
  155. }
  156. if(!password.value){
  157. errorMsg += "&nbsp;&nbsp;密码不能为空!";
  158. }
  159. var patt= /(?!^(\d+|[a-zA-Z]+|[~!@#$%^&*?]+)$)^[\w~!@#$%\^&*?]{8,20}$/g;
  160. var pwd =$("#password").val();
  161. if(!patt.test(pwd)){
  162. pasFormat=false;
  163. }
  164. if(errorMsg != "" ){
  165. $(".login_info").html(errorMsg);
  166. $(".login_info").show();
  167. }
  168. else{
  169. $(".login_info").show();
  170. $(".login_info").html("&nbsp;&nbsp;正在登录中...");
  171. //前台做md5加密传输
  172. var md5password=md5(password.value);
  173. //登录处理
  174. $.ajax({
  175. type: "POST",
  176. url:"/nwyj/ws/sys/LoginService/Login",
  177. data: {"username":loginName.value,"password":md5password},
  178. success: function(data){
  179. if(!!data && data.LoginInfo.st == 0){
  180. $(".login_info").html("&nbsp;&nbsp;登录成功,正在转到主页...");
  181. window.name = JSON.stringify(data);
  182. //alert( window.name);
  183. window.location="/nwyj/page/frameWork.html";
  184. /* }else if(!!data && data.LoginInfo.st == 1){
  185. $(".login_info").html("&nbsp;&nbsp;密码错误次数达到5次,请"+data.LoginInfo.mod_date+"分钟后再登录!");
  186. } else if(!!data && data.LoginInfo.st == 2){
  187. $(".login_info").html("&nbsp;&nbsp;用户名或密码错误,请重新登录!");
  188. }
  189. else if(!!data && data.LoginInfo.st == 2){
  190. if(data.LoginInfo.mod_date==0){
  191. $(".login_info").html("&nbsp;&nbsp;密码错误次数达到5次,请30分钟后再登录!");
  192. }else{
  193. if(pasFormat){
  194. $(".login_info").html("&nbsp;&nbsp;密码错误!还剩下"+data.LoginInfo.mod_date+"次机会!");
  195. }else{
  196. $(".login_info").html("&nbsp;&nbsp;密码格式错误!还剩下"+data.LoginInfo.mod_date+"次机会!");
  197. }
  198. $(".login_info").html("&nbsp;&nbsp;用户名或密码错误!");
  199. }
  200. */
  201. }else {
  202. $(".login_info").html("&nbsp;&nbsp;用户名或密码错误!");
  203. }
  204. },
  205. error:function(data){
  206. $(".login_info").html("&nbsp;&nbsp;登陆失败!");
  207. }
  208. });
  209. }
  210. }
  211. </script>
  212. </body>
  213. </html>