index_test.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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 content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0;" name="viewport" />
  5. <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  6. <meta http-equiv="X-UA-Compatible" content="IE=8"/>
  7. <title>南方电网应急指挥系统--登录</title>
  8. <link rel="Shortcut Icon" href="images/favicon.png"/>
  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. html{
  13. width:100%;
  14. height:100%;
  15. margin:0px;
  16. overflow: hidden;
  17. }
  18. body{
  19. margin:0px;
  20. width:100%;
  21. height:100%;
  22. background-color: #e5e9ec;
  23. }
  24. .login_contant{
  25. top: 10%;
  26. right: 0;
  27. width:100%;
  28. position: absolute;
  29. }
  30. .login_main{
  31. z-index:-1;
  32. width:100%;
  33. }
  34. /*
  35. .login_logo{
  36. position: absolute;
  37. top: 12%;
  38. right: 45%;
  39. width: 40%;
  40. }
  41. .login_text{
  42. position: absolute;
  43. top: 27%;
  44. right: 19.5%;
  45. width: 18.5%;
  46. font-size: 1.2em;
  47. font-family: "微软雅黑";
  48. text-align:center;
  49. color: white;
  50. } */
  51. .login_form {
  52. position: absolute;
  53. top: 23%;
  54. right: 19.5%;
  55. width: 18.5%;
  56. height: 58%;
  57. }
  58. .login_img{
  59. z-index:-1;
  60. width: 100%;
  61. height: 100%
  62. }
  63. div.login_position{
  64. border: 0px;
  65. padding: 0px 0px 0px 3%;
  66. width: 97%;
  67. white-space: nowrap;
  68. word-break: keep-all;
  69. word-wrap: normal;
  70. line-height: 100%;
  71. position: relative;
  72. margin-bottom: 6.8%;
  73. cursor: text;
  74. }
  75. div.login_user{
  76. height: 48%;
  77. }
  78. div.login_pass{
  79. height: 18%;
  80. }
  81. input{
  82. position:absolute;
  83. bottom:1px;
  84. left: 17%;
  85. border-style: none;
  86. width: 82%;
  87. font-size: 18px;
  88. background-color: transparent;
  89. border: 0px;
  90. outline: none;
  91. /* z-index: 10; */
  92. }
  93. input#username{
  94. height: 33%;
  95. line-height:45px;
  96. }
  97. input#password{
  98. height: 90%;
  99. line-height:45px;
  100. }
  101. .login_button{
  102. text-align: center;
  103. width:100%;
  104. padding: 5% 0px 0px 3%;
  105. width: 97%;
  106. }
  107. .login_button_position{
  108. margin: 0px auto;
  109. cursor:pointer;
  110. border: 0px;
  111. display: inline-block;
  112. width:100%;
  113. }
  114. .login_info{
  115. margin-left:3%;
  116. margin-top: 10%;
  117. font-size: 12px;
  118. }
  119. </style>
  120. </head>
  121. <body >
  122. <div class="login_contant">
  123. <img class="login_main" src="/nwyj/images/index/loginPage_bg.png"/>
  124. <!-- <img class="login_logo" src="/nwyj/images/index/login_logo.png"/>
  125. <div class="login_text"> 应急指挥管理系统</div> -->
  126. <div class="login_form">
  127. <div class="login_user login_position"><img class="login_img" src="/nwyj/images/index/login_user.png"/><input type="text" id="username" onkeyup="clearpassword()" watermark=" 用 户 名 " value=""></div>
  128. <div class="login_pass login_position"><img class="login_img" src="/nwyj/images/index/login_pass.png"/><input type="password" id="password" watermark=" 密 码 " value=""></div>
  129. <div class="login_button">
  130. <img src="/nwyj/images/index/login_login.png" class="login_button_login login_button_position" onclick="login()" ></img>
  131. </div>
  132. <div class="login_info" style="display:none;"></div>
  133. </div>
  134. </div>
  135. <script type="text/javascript" >
  136. //帐号输入框变动时,清空密码框(2015.10.13 梁俊鹏)
  137. function clearpassword(){
  138. var _username = $("#username").val();
  139. $("#password").val("");
  140. }
  141. $(function(){
  142. //防止iframe内出现登录页
  143. if (window != top)
  144. top.location.href = location.href;
  145. //居中
  146. document.getElementById("username").focus();
  147. $("#username").keydown(function(event){
  148. if(event.keyCode==13){
  149. login();
  150. }
  151. })
  152. $("#password").keydown(function(event){
  153. if(event.keyCode==13){
  154. login();
  155. }
  156. })
  157. $(".login_position").live("click",function(){
  158. $(this).find("input").focus();
  159. });
  160. })
  161. /* function setCaretPosition(ctrl,pos){
  162. ctrl.focus();
  163. if(ctrl.setSelectionRange){
  164. ctrl.setSelectionRange(pos,pos);
  165. }else if(ctrl.createTextRange){
  166. var range = ctrl.createTextRange();
  167. range.collapse(true);
  168. range.moveEnd('character',pos);
  169. range.moveStart('character',pos);
  170. range.select();
  171. }
  172. } */
  173. //登录
  174. function login() {
  175. var errorMsg = "";
  176. var loginName =document.getElementById("username");
  177. var password = document.getElementById("password");
  178. var pasFormat=true;
  179. if(!loginName.value){
  180. //errorMsg += "&nbsp;用户名不能为空!";
  181. errorMsg += "用户名不能为空!";
  182. }
  183. if(!password.value){
  184. errorMsg += "密码不能为空!";
  185. }
  186. var patt= /(?!^(\d+|[a-zA-Z]+|[~!@#$%^&*?]+)$)^[\w~!@#$%\^&*?]{8,20}$/g;
  187. var pwd =$("#password").val();
  188. if(!patt.test(pwd)){
  189. pasFormat=false;
  190. }
  191. if(errorMsg != "" ){
  192. $(".login_info").html(errorMsg);
  193. $(".login_info").show();
  194. }
  195. else{
  196. $(".login_info").show();
  197. $(".login_info").html("正在登录中...");
  198. //前台做md5加密传输
  199. var md5password=md5(password.value);
  200. //登录处理
  201. $.ajax({
  202. type: "POST",
  203. url:"/nwyj/ws/sys/LoginService/Login",
  204. data: {"username":loginName.value,"password":md5password},
  205. success: function(data){
  206. if(!!data && data.LoginInfo.st == 0){
  207. $(".login_info").html("登录成功,正在转到主页...");
  208. //console.log(JSON.stringify(data));
  209. window.name = JSON.stringify(data);
  210. //alert( window.name);
  211. window.location="/nwyj/page/frameWork.html";
  212. }else if(!!data && data.LoginInfo.st == 1){
  213. //$(".login_info").html("密码错误次数达到5次,请"+data.LoginInfo.mod_date+"分钟后再登录!");
  214. //} else if(!!data && data.LoginInfo.st == 2){
  215. $(".login_info").html("用户名或密码错误,请重新登录!");
  216. //loginName.value="";
  217. //password.value="";
  218. //loginName.focus();
  219. }
  220. /* else if(!!data && data.LoginInfo.st == 2){
  221. if(data.LoginInfo.mod_date==0){
  222. $(".login_info").html("&nbsp;&nbsp;密码错误次数达到5次,请30分钟后再登录!");
  223. }else{
  224. if(pasFormat){
  225. $(".login_info").html("&nbsp;&nbsp;密码错误!还剩下"+data.LoginInfo.mod_date+"次机会!");
  226. }else{
  227. $(".login_info").html("&nbsp;&nbsp;密码格式错误!还剩下"+data.LoginInfo.mod_date+"次机会!");
  228. }
  229. $(".login_info").html("&nbsp;&nbsp;用户名或密码错误!");
  230. }
  231. }
  232. else if(!!data && data.LoginInfo.st == 3){
  233. $(".login_info").html("&nbsp;&nbsp;用户名或密码错误!");
  234. } */
  235. },
  236. error:function(data){
  237. $(".login_info").html("登陆失败!");
  238. }
  239. });
  240. }
  241. }
  242. </script>
  243. </body>
  244. </html>