Sin descripción

login.html 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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.min.js?v=2.1.4"></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. </head>
  21. <body class="signin">
  22. <div class="signinpanel">
  23. <div class="d_left" style="width: 55%;">
  24. <div class="lg_boxs"> <img src="./img/lg.png" alt="" /></div>
  25. </div>
  26. <div class=" d_right" style="width: 45%;">
  27. <form class="dl_form" method="get">
  28. <div class="hj_box"> <img class=" hj" src="./img/hj.png" alt="" /></div>
  29. <div class="user iut">
  30. <i class="i1 us"></i>
  31. <input type="text" placeholder="请输入管理账号" id="user">
  32. <i class="ts user_ts"></i>
  33. </div>
  34. <div class="fj iut">
  35. <i class="i1 yz"></i>
  36. <input type="text" placeholder="请输入分机号" id="fj">
  37. <i class="ts fj_ts"></i>
  38. </div>
  39. <div class="password iut">
  40. <i class="i1 ps"></i>
  41. <input type="password" placeholder="请输入密码" id="password">
  42. <i class="ts password_ts"></i>
  43. </div>
  44. <div class="b_box">
  45. <div class="btns" type="button">登录</div>
  46. </div>
  47. <h3 class="t_bootm">技术服务热线:400-637-1311</h3>
  48. <div class="Downlone_">
  49. <a href="ExeWork/LeCallCenterSetup.exe">下载客户端</a><br/><br/>
  50. <a href="ExeWork/Microsoft.NET4.0.exe">下载安装环境</a><br /><br />
  51. <a href="ExeWork/vcredist_x86.exe">安装异常补充包</a>
  52. </div>
  53. </form>
  54. </div>
  55. </div>
  56. <script>
  57. $(function() {
  58. /*输入框样式改变*/
  59. $("#user").focus(function() {
  60. $(this).parent().addClass("_success");
  61. });
  62. $("#user").blur(function() {
  63. $(this).parent().removeClass("_success");
  64. })
  65. $("#fj").focus(function() {
  66. $(this).parent().addClass("_success");
  67. });
  68. $("#fj").blur(function() {
  69. $(this).parent().removeClass("_success");
  70. })
  71. $("#password").focus(function() {
  72. $(this).parent().addClass("_success");
  73. });
  74. $("#password").blur(function() {
  75. $(this).parent().removeClass("_success");
  76. });
  77. /*cook存储数据*/
  78. if($.cookie("username")) {
  79. //取值如果存在则赋值
  80. $("#user").val($.cookie("user")); //用户名
  81. $("#fj").val($.cookie("fj"));
  82. }
  83. //键盘事件
  84. document.onkeydown = function(e) {
  85. var theEvent = window.event || e;
  86. var code = theEvent.keyCode || theEvent.which;
  87. if(code == 13) {
  88. $(".btns").click();
  89. }
  90. }
  91. $(".btns").click(function() {
  92. var User = $("#user").val();
  93. var Fj = $("#fj").val();
  94. var Password = $("#password").val();
  95. /*保存COOK*/
  96. //$.cookie("user", $("#user").val(),{expires: 7,secure:true});
  97. //$.cookie("fj", $("#fj").val(), {expires: 7,secure:true});
  98. /*表单验证*/
  99. if(User == "" || Fj == "" || Password == "") {
  100. $(".ts").addClass("Yz_error");
  101. if($("#user").val() == "") {
  102. $("#user").focus(function() {
  103. $(".user_ts").removeClass("Yz_error");
  104. $(".fj_ts").removeClass("Yz_error");
  105. $(".password_ts").removeClass("Yz_error");
  106. $(this).parent().addClass("_success");
  107. });
  108. } else {
  109. $(".user_ts").addClass("Yz_success");
  110. }
  111. } else {
  112. /*请求后台*/
  113. $.ajax({
  114. type: "post",
  115. url: huayi.config.callcenter_url + "/Login/login",
  116. dataType: 'json',
  117. async: true,
  118. data: {
  119. username: User,
  120. extensionphone: Fj,
  121. password: Password
  122. },
  123. success: function(data) {
  124. /*验证请求*/
  125. if(data.state == "success") {
  126. $.cookie("token", data.data.token, {
  127. expires: 7
  128. });
  129. $.cookie("extno", Fj, {
  130. expires: 7
  131. });
  132. $.cookie("u_code", User, {
  133. expires: 7
  134. });
  135. var expireDate = data.data.date.split(' ')[0];
  136. var expireDay = data.data.days;
  137. var expireText = '<span style="color:#f00;">软件到期时间:' + expireDate + ',还剩' + expireDay +'天,请联系软件厂家</span>'
  138. if (expireDay * 1 > 0) {
  139. layer.confirm(expireText, {
  140. btn: ['确定'] //按钮
  141. }, function () {
  142. window.location.href = "index.html";
  143. })
  144. }
  145. else {
  146. window.location.href = "index.html";
  147. }
  148. } else {
  149. //alert("登录失败");
  150. $("#user").val('');
  151. $("#fj").val('');
  152. $("#password").val('');
  153. }
  154. }
  155. });
  156. }
  157. });
  158. });
  159. </script>
  160. </body>
  161. </html>