中鑫之宝5.0前端

login.html 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. <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">
  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">
  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">
  54. <i class="ts password_ts"></i>
  55. </div>
  56. <div class="b_box">
  57. <div class="btns" type="button">登录</div>
  58. </div>
  59. <h3 class="t_bootm">技术服务热线:400-637-1311</h3>
  60. <div class="Downlone_">
  61. <div style="display: inline-block;vertical-align: middle;">
  62. <a href="ExeWork/LeCallCenterSetup.exe">下载客户端</a>
  63. |
  64. <a href="ExeWork/Microsoft.NET4.0.exe">下载安装环境</a>
  65. |
  66. <a href="ExeWork/vcredist_x86.exe">安装异常补充包</a>
  67. </div>
  68. <span class="center"></span>
  69. </div>
  70. </div>
  71. </form>
  72. </div>
  73. </div>
  74. <script>
  75. $(function() {
  76. /*输入框样式改变*/
  77. $("#user").focus(function() {
  78. $(this).parent().addClass("_success");
  79. });
  80. $("#user").blur(function() {
  81. $(this).parent().removeClass("_success");
  82. })
  83. $("#fj").focus(function() {
  84. $(this).parent().addClass("_success");
  85. });
  86. $("#fj").blur(function() {
  87. $(this).parent().removeClass("_success");
  88. })
  89. $("#password").focus(function() {
  90. $(this).parent().addClass("_success");
  91. });
  92. $("#password").blur(function() {
  93. $(this).parent().removeClass("_success");
  94. });
  95. /*cook存储数据*/
  96. if($.cookie("username")) {
  97. //取值如果存在则赋值
  98. $("#user").val($.cookie("user")); //用户名
  99. $("#fj").val($.cookie("fj"));
  100. }
  101. //键盘事件
  102. document.onkeydown = function(e) {
  103. var theEvent = window.event || e;
  104. var code = theEvent.keyCode || theEvent.which;
  105. if(code == 13) {
  106. $(".btns").click();
  107. }
  108. }
  109. $(".btns").click(function() {
  110. var User = $("#user").val();
  111. var Fj = $("#fj").val();
  112. var Password = $("#password").val();
  113. /*保存COOK*/
  114. //$.cookie("user", $("#user").val(),{expires: 7,secure:true});
  115. //$.cookie("fj", $("#fj").val(), {expires: 7,secure:true});
  116. /*表单验证*/
  117. if(User == "" || Fj == "" || Password == "") {
  118. $(".ts").addClass("Yz_error");
  119. if($("#user").val() == "") {
  120. $("#user").focus(function() {
  121. $(".user_ts").removeClass("Yz_error");
  122. $(".fj_ts").removeClass("Yz_error");
  123. $(".password_ts").removeClass("Yz_error");
  124. $(this).parent().addClass("_success");
  125. });
  126. } else {
  127. $(".user_ts").addClass("Yz_success");
  128. }
  129. } else {
  130. /*请求后台*/
  131. $.ajax({
  132. type: "post",
  133. url: huayi.config.callcenter_url + "/Login/login",
  134. dataType: 'json',
  135. async: true,
  136. data: {
  137. username: User,
  138. extensionphone: Fj,
  139. password: Password
  140. },
  141. success: function(data) {
  142. /*验证请求*/
  143. if(data.state == "success") {
  144. $.cookie("token", data.data.token, {
  145. expires: 7
  146. });
  147. $.cookie("extno", Fj, {
  148. expires: 7
  149. });
  150. window.location.href = "index.html";
  151. } else {
  152. //alert("登录失败");
  153. $("#user").val('');
  154. $("#fj").val('');
  155. $("#password").val('');
  156. }
  157. }
  158. });
  159. }
  160. });
  161. });
  162. /*点击提交*/
  163. /*cook*/
  164. </script>
  165. </body>
  166. </html>