暂无描述

login.html 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>安阳市大数据分析</title>
  6. <script src="Script/Common/huayi.load.js"></script>
  7. <script src="Script/Common/huayi.config.js"></script>
  8. <link rel="stylesheet" href="./css/test-1920.css">
  9. <script src="js/jquery.min.js"></script>
  10. <script src="js/jquery.md5.js"></script>
  11. <script src="js/crypto-js.js"></script>
  12. <style type="text/css">
  13. body {
  14. background-image: url(./images/login.png);
  15. }
  16. .wrap_login {
  17. text-align: center;
  18. }
  19. h1 {
  20. padding: 35px 0;
  21. color: #136291;
  22. font-size: 45px;
  23. }
  24. .info_login {
  25. width: 85%;
  26. height: 790px;
  27. margin: 0 auto;
  28. margin-top: 50px;
  29. text-align: center;
  30. background-image: url(./images/login2.png);
  31. background-repeat: no-repeat;
  32. background-size: 100% 100%;
  33. position: relative;
  34. /* background-color: #007AFF; */
  35. }
  36. .info_login h2 {
  37. padding-top: 40px;
  38. /* font-size: 20px;
  39. font-weight: bold; */
  40. }
  41. .info_login div {
  42. position: absolute;
  43. top: 200px;
  44. right: 200px;
  45. text-align: center;
  46. font-size: 20px;
  47. }
  48. .info_login div h4 {
  49. margin-bottom: 40px;
  50. }
  51. .info_login input {
  52. width: 460px;
  53. height: 60px;
  54. border-radius: 25px;
  55. padding: 0 30px;
  56. border: none;
  57. outline: none;
  58. background-color: #f3f4f6;
  59. margin-bottom: 40px;
  60. font-size: 18px;
  61. }
  62. .info_login input::-webkit-input-placeholder {
  63. font-size: 16px;
  64. font-weight: 400;
  65. color: #b2b3b3;
  66. }
  67. button {
  68. width: 500px;
  69. height: 60px;
  70. border-radius: 25px;
  71. padding: 0 20px;
  72. border: none;
  73. outline: none;
  74. background-image: linear-gradient(#0096ff, #00deff);
  75. font-size: 20px;
  76. color: $fff;
  77. font-weight: 700;
  78. cursor: pointer;
  79. }
  80. </style>
  81. </head>
  82. <body>
  83. <div class="wrap_login">
  84. <h1>安阳市12345热线大数据分析系统</h1>
  85. <div class="info_login">
  86. <h2>真实倾听群众呼声 真实反映群众意愿 真正解决群众困难</h2>
  87. <div>
  88. <h4>欢迎登录<span style="color: rgb(35,159,255);">安阳市12345热线大数据分析系统</span></h4>
  89. <input type="text" class="username" placeholder="请输入您的账号"><br>
  90. <input type="password" class="password" placeholder="请输入您的密码"><br>
  91. <button type="button" id="submit_btn">登陆</button>
  92. </div>
  93. </div>
  94. </div>
  95. </body>
  96. <script>
  97. $("#submit_btn").click(function() {
  98. var gl_psw = $('.password').val()
  99. var currenttime = CurentTime();
  100. var datatime = currenttime.split(' ')[1].split(':').join('')
  101. var key = CryptoJS.enc.Utf8.parse(")O[9d]6,YF}+efcaj{+8>Z'e9M" + datatime);
  102. var gl_psw = CryptoJS.enc.Utf8.parse($.md5(gl_psw));
  103. var encrypted = CryptoJS.AES.encrypt(gl_psw, key, {
  104. mode: CryptoJS.mode.ECB,
  105. padding: CryptoJS.pad.Pkcs7
  106. });
  107. if ($(".username").val() == '') {
  108. layer.msg('用户名不许为空');
  109. return;
  110. }
  111. if ($(".password").val() == '') {
  112. layer.msg('密码不许为空');
  113. return;
  114. }
  115. $.ajax({
  116. type: "post",
  117. url: huayi.config.callcenter_url + "/Login/login",
  118. dataType: 'json',
  119. async: true,
  120. data: {
  121. username: $(".username").val(),
  122. password: encrypted.toString(),
  123. LoginTime: currenttime
  124. },
  125. success: function(data) {
  126. /*验证请求*/
  127. if(data.state == "success") {
  128. localStorage.setItem('datatoken',data.data.token)
  129. window.location.href = "index.html";
  130. }
  131. }
  132. });
  133. })
  134. function CurentTime() {
  135. var now = new Date();
  136. var year = now.getFullYear(); //年
  137. var month = now.getMonth() + 1; //月
  138. var day = now.getDate(); //日
  139. var hh = now.getHours(); //时
  140. var mm = now.getMinutes(); //分
  141. var ss = now.getSeconds(); //秒
  142. var clock = year + "-";
  143. if (month < 10)
  144. clock += "0";
  145. clock += month + "-";
  146. if (day < 10)
  147. clock += "0";
  148. clock += day + " ";
  149. if (hh < 10)
  150. clock += "0";
  151. clock += hh + ":";
  152. if (mm < 10) clock += '0';
  153. clock += mm + ":";
  154. if (ss < 10) clock += '0';
  155. clock += ss;
  156. return (clock);
  157. }
  158. </script>
  159. </html>