Brak opisu

login.html 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="x-ua-compatible" content="ie=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  7. <title>登录</title>
  8. <meta name="keywords">
  9. <meta name="description">
  10. <meta name="renderer" content="webkit">
  11. <link rel="shortcut icon" href="img/32.ico" />
  12. <link href="./css/bootstrap.min.css" rel="stylesheet">
  13. <link href="./css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
  14. <link href="./css/animate.min.css" rel="stylesheet">
  15. <link href="./css/style.min.css" rel="stylesheet">
  16. <link href="./css/login.min.css" rel="stylesheet">
  17. <script src="./Script/Common/huayi.load.js"></script>
  18. <script src="./Script/Common/huayi.config.js"></script>
  19. <script src="./js/jquery.md5.js"></script>
  20. <script src="./js/aes/crypto-js.js"></script>
  21. <style>
  22. .d_left {
  23. /* background: -webkit-linear-gradient(left, rgb(164,190,225), rgb(108,129,168)); */
  24. background: rgba(162, 178, 204, .34);
  25. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#19ffffff, endColorstr=#19ffffff);
  26. height: 645px;
  27. text-align: center;
  28. display: table;
  29. float: left;
  30. }
  31. .lg_boxs {
  32. display: table-cell;
  33. vertical-align: middle
  34. }
  35. </style>
  36. <!--[if lte IE 7]>
  37. <style type="text/css">?
  38. .d_left{
  39. background-color: #fff;
  40. position:relative;
  41. overflow:hidden;
  42. }
  43. .lg_boxs{
  44. position:absolute;
  45. left:50%;top:50%;
  46. }
  47. .d_left img{
  48. position:relative;
  49. left:-98%;top:-50%;
  50. }
  51. </style>
  52. <![endif]-->
  53. </head>
  54. <body class="signin">
  55. <div class="signinpanel">
  56. <div class="d_left" style="width: 55%;">
  57. <!--<div class="lg_boxs"> <img src="img/sqLogo.png" alt="" /></div>-->
  58. </div>
  59. <div class="d_right" style="width: 45%;">
  60. <form class="dl_form" method="get">
  61. <div class="hj_box"> <img class=" hj" src="./img/hj.png" alt="" /></div>
  62. <div class="user iut">
  63. <i class="i1 us"></i>
  64. <input type="text" placeholder="请输入管理账号" id="user">
  65. <i class="ts user_ts"></i>
  66. </div>
  67. <div class="fj iut">
  68. <i class="i1 yz"></i>
  69. <input type="text" placeholder="请输入分机号" id="fj">
  70. <i class="ts fj_ts"></i>
  71. </div>
  72. <div class="password iut">
  73. <i class="i1 ps"></i>
  74. <input type="password" placeholder="请输入密码" id="password">
  75. <i class="ts password_ts"></i>
  76. </div>
  77. <div class="b_box">
  78. <div class="btns" type="button">登录</div>
  79. </div>
  80. </form>
  81. </div>
  82. </div>
  83. <script>
  84. $(function() {
  85. /*输入框样式改变*/
  86. $("#user").focus(function() {
  87. $(this).parent().addClass("_success");
  88. });
  89. $("#user").blur(function() {
  90. $(this).parent().removeClass("_success");
  91. })
  92. $("#fj").focus(function() {
  93. $(this).parent().addClass("_success");
  94. });
  95. $("#fj").blur(function() {
  96. $(this).parent().removeClass("_success");
  97. })
  98. $("#password").focus(function() {
  99. $(this).parent().addClass("_success");
  100. });
  101. $("#password").blur(function() {
  102. $(this).parent().removeClass("_success");
  103. });
  104. /*cook存储数据*/
  105. if($.cookie("username")) {
  106. //取值如果存在则赋值
  107. $("#user").val($.cookie("user")); //用户名
  108. $("#fj").val($.cookie("fj"));
  109. }
  110. $('input').bind('keypress', function(event) {
  111. if(event.keyCode == "13") {
  112. $(".btns").trigger("click");
  113. }
  114. });
  115. function CurentTime(){
  116. var now = new Date();
  117. var year = now.getFullYear(); //年
  118. var month = now.getMonth() + 1; //月
  119. var day = now.getDate(); //日
  120. var hh = now.getHours(); //时
  121. var mm = now.getMinutes(); //分
  122. var ss = now.getSeconds(); //秒
  123. var clock = year + "-";
  124. if(month < 10)
  125. clock += "0";
  126. clock += month + "-";
  127. if(day < 10)
  128. clock += "0";
  129. clock += day + " ";
  130. if(hh < 10)
  131. clock += "0";
  132. clock += hh + ":";
  133. if (mm < 10) clock += '0';
  134. clock += mm + ":";
  135. if (ss < 10) clock += '0';
  136. clock += ss;
  137. return(clock);
  138. }
  139. $(".btns").click(function() {
  140. var User = $("#user").val();
  141. var Fj = $("#fj").val();
  142. var Password = $("#password").val();
  143. /*保存COOK*/
  144. //$.cookie("user", $("#user").val(),{expires: 7,secure:true});
  145. //$.cookie("fj", $("#fj").val(), {expires: 7,secure:true});
  146. /*表单验证*/
  147. if(User == "" || Fj == "" || Password == "") {
  148. $(".ts").addClass("Yz_error");
  149. if($("#user").val() == "") {
  150. $("#user").focus(function() {
  151. $(".user_ts").removeClass("Yz_error");
  152. $(".fj_ts").removeClass("Yz_error");
  153. $(".password_ts").removeClass("Yz_error");
  154. $(this).parent().addClass("_success");
  155. });
  156. } else {
  157. $(".user_ts").addClass("Yz_success");
  158. }
  159. } else {
  160. var currenttime=CurentTime();
  161. var datatime=currenttime.split(' ')[1].split(':').join('')
  162. var key = CryptoJS.enc.Utf8.parse(")O[9d]6,YF}+efcaj{+8>Z'e9M"+datatime);
  163. var zx_psw = CryptoJS.enc.Utf8.parse($.md5(Password));
  164. var encrypted = CryptoJS.AES.encrypt(zx_psw, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});
  165. /*请求后台*/
  166. $.ajax({
  167. type: "post",
  168. url: huayi.config.callcenter_url + "/Login/login",
  169. dataType: 'json',
  170. async: true,
  171. data: {
  172. username: User,
  173. extensionphone: Fj,
  174. LoginTime:currenttime,
  175. password:encrypted.toString()
  176. },
  177. success: function(data) {
  178. /*验证请求*/
  179. if(data.state == "success") {
  180. $.cookie("token", data.data.token, {
  181. expires: 7
  182. });
  183. $.cookie("extno", Fj, {
  184. expires: 7
  185. });
  186. window.location.href = "index.html";
  187. }
  188. }
  189. });
  190. }
  191. });
  192. });
  193. /*点击提交*/
  194. /*cook*/
  195. </script>
  196. </body>
  197. </html>