Aucune description

login.html 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  6. <title>登录</title>
  7. <meta name="keywords">
  8. <meta name="description">
  9. <meta name="renderer" content="webkit|ie-comp|ie-stand" />
  10. <link rel="shortcut icon" href="img/32.ico" />
  11. <link href="./css/bootstrap.min.css" rel="stylesheet">
  12. <link href="./css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
  13. <link href="./css/animate.min.css" rel="stylesheet">
  14. <link href="./css/style.min.css" rel="stylesheet">
  15. <link href="./css/login.min.css" rel="stylesheet">
  16. <script src="./js/jQuery-3.3.1.js"></script>
  17. <script src="./js/jquery.cookie.js"></script>
  18. <script src="Script/Common/huayi.load.js"></script>
  19. <script src="Script/Common/huayi.config.js"></script>
  20. <style>
  21. .center {
  22. display: inline-block;
  23. height: 100%;
  24. vertical-align: middle;
  25. }
  26. </style>
  27. </head>
  28. <body class="signin">
  29. <div class="signinpanel">
  30. <div class="d_left" style="width: 55%;text-align: center;">
  31. <div class="lg_boxs" style="display: inline-block; vertical-align: middle; width: 90%;"> <img src="./img/lg.png" alt="" /></div>
  32. <span class="center"></span>
  33. </div>
  34. <div class=" d_right" style="width: 45%;">
  35. <form class="dl_form" method="get">
  36. <div class="hj_box">
  37. <img class=" hj" src="./img/hj.png" alt="" />
  38. <span class="center"></span>
  39. </div>
  40. <div class="input_box">
  41. <div class="user iut">
  42. <i class="i1 us"></i>
  43. <input type="text" placeholder="请输入管理账号" id="user" autocomplete="off">
  44. <i class="ts user_ts"></i>
  45. </div>
  46. <div class="fj iut">
  47. <i class="i1 yz"></i>
  48. <input type="text" placeholder="请输入分机号" id="fj" autocomplete="off">
  49. <i class="ts fj_ts"></i>
  50. </div>
  51. <div class="password iut">
  52. <i class="i1 ps"></i>
  53. <input type="password" placeholder="请输入密码" id="password" autocomplete="off">
  54. <i class="ts password_ts"></i>
  55. </div>
  56. <div class="b_box">
  57. <div class="btns" type="button">登录</div>
  58. </div>
  59. <div class="Downlone_ ">
  60. <div style="display: inline-block;vertical-align: middle;">
  61. <a href="ExeWork/LeadCallSetup.exe">下载客户端</a>
  62. |
  63. <a href="ExeWork/Microsoft.NET4.0.exe">下载安装环境</a>
  64. |
  65. <a href="ExeWork/vcredist_x86.exe">安装异常补充包</a>
  66. |
  67. <a href="ExeWork/eyeBeam1.5-1.zip">软电话</a>
  68. |
  69. <a href="ExeWork/使用手册.zip">使用手册</a>
  70. </div>
  71. <span class="center"></span>
  72. </div>
  73. </div>
  74. </form>
  75. </div>
  76. </div>
  77. <script>
  78. $(function () {
  79. //if ($.cookie("loginname")) {
  80. // $("#user").val($.cookie("loginname"));
  81. //}
  82. //if ($.cookie("extno")) {
  83. // $("#fj").val($.cookie("extno"));
  84. //}
  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("username")); //用户名
  108. $("#fj").val($.cookie("extno"));
  109. }
  110. //键盘事件
  111. document.onkeydown = function (e) {
  112. var theEvent = window.event || e;
  113. var code = theEvent.keyCode || theEvent.which;
  114. if (code == 13) {
  115. $(".btns").click();
  116. }
  117. }
  118. $(".btns").click(function () {
  119. var User = $("#user").val();
  120. var Fj = $("#fj").val();
  121. var Password = $("#password").val();
  122. /*保存COOK*/
  123. //$.cookie("user", $("#user").val(),{expires: 7,secure:true});
  124. //$.cookie("fj", $("#fj").val(), {expires: 7,secure:true});
  125. /*表单验证*/
  126. if (User == "" || Fj == "" || Password == "") {
  127. $(".ts").addClass("Yz_error");
  128. if ($("#user").val() == "") {
  129. $("#user").focus(function () {
  130. $(".user_ts").removeClass("Yz_error");
  131. $(".fj_ts").removeClass("Yz_error");
  132. $(".password_ts").removeClass("Yz_error");
  133. $(this).parent().addClass("_success");
  134. });
  135. } else {
  136. $(".user_ts").addClass("Yz_success");
  137. }
  138. } else {
  139. /*请求后台*/
  140. $.ajax({
  141. type: "post",
  142. url: huayi.config.callcenter_url + "/Login/login",
  143. dataType: 'json',
  144. async: true,
  145. data: {
  146. username: User,
  147. extensionphone: Fj,
  148. password: Password
  149. },
  150. success: function (data) {
  151. /*验证请求*/
  152. if (data.state == "success") {
  153. $.cookie("token", data.data.token, { expires: 7 });
  154. if ($.cookie("username") !== User) {
  155. $.cookie("username", User, { expires: 7 });
  156. }
  157. if ($.cookie("extno") !== Fj) {
  158. $.cookie("extno", Fj, { expires: 7 });
  159. }
  160. window.location.href = "index.html";
  161. } else {
  162. //alert("登录失败");
  163. //$("#user").val('');
  164. //$("#fj").val('');
  165. //$("#password").val('');
  166. }
  167. }
  168. });
  169. }
  170. });
  171. });
  172. /*点击提交*/
  173. /*cook*/
  174. </script>
  175. </body>
  176. </html>