暂无描述

login.html 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. <script src="Script/Common/huayi.load.js"></script>
  12. <script src="Script/Common/huayi.config.js"></script>
  13. <link href="./css/login.css" rel="stylesheet">
  14. <!--[if lt IE 9]>
  15. <meta http-equiv="refresh" content="0;ie.html" />
  16. <![endif]-->
  17. </head>
  18. <body class="signin">
  19. <div class="container">
  20. <div class="row clearfix">
  21. <!-- <div class="signin_left col-md-5"></div> -->
  22. <div class="signin_right col-md-5">
  23. <div class="signin_panel">
  24. <div class="logo_title">
  25. <div class="logo_img">
  26. <img src="img/logo_shuanghui.png" alt="" width="85px" height="60px"/>
  27. </div>
  28. <div class="logo_content">
  29. <div class="logo_text">
  30. <span>双汇客服中心管理系统</span>
  31. </div>
  32. <div class="logo_footer">
  33. <!-- <img src="img/logo_footer.png" alt="" width="470px" height="20px" /> -->
  34. </div>
  35. </div>
  36. </div>
  37. <div class="sigin_wrapper">
  38. <div class="signin_user">
  39. <i class="signin_icons"></i>
  40. <input class="form-control" type="text" placeholder="请输入您的管理账号" id="user" autofocus autocomplete="off">
  41. <i class="ts user_ts"></i>
  42. </div>
  43. <div class="signin_seat">
  44. <i class="signin_icons"></i>
  45. <input class="form-control" type="text" placeholder="请输入分机号" id="userSeat" autocomplete="off">
  46. </div>
  47. <div class="signin_password">
  48. <i class="signin_icons"></i>
  49. <i class="keyboard_icons"></i>
  50. <input class="form-control" type="password" placeholder="请输入您的密码" id="password" autocomplete="off">
  51. <i class="ts password_ts"></i>
  52. </div>
  53. <div class="clearfix singin_rpassword">
  54. <div class="rpassword">
  55. <label for="rpassword">
  56. <input type="checkbox" id="rpassword">
  57. <span class="checkbox_icon"></span>
  58. 记住密码
  59. </label>
  60. </div>
  61. </div>
  62. <div class="btns" type="button">登录</div>
  63. </div>
  64. <!-- <div class="signfooter">
  65. <a href="ExeWork/LeCallCenterSetup.exe">下载客户端|</a>
  66. <a href="ExeWork/Microsoft.NET4.5.2.exe">下载安装环境|</a>
  67. <a href="ExeWork/vc_redist.x86.exe">安装包异常补充包</a>
  68. </div> -->
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. <script>
  74. $(function () {
  75. /*输入框样式改变*/
  76. $("#user").focus(function () {
  77. $(this).parent().addClass("_success");
  78. });
  79. $("#user").blur(function () {
  80. $(this).parent().removeClass("_success");
  81. });
  82. $("#password").focus(function () {
  83. $(this).parent().addClass("_success");
  84. });
  85. $("#password").blur(function () {
  86. $(this).parent().removeClass("_success");
  87. });
  88. /*cook存储数据*/
  89. if ($.cookie("username")) {
  90. //取值如果存在则赋值
  91. $("#user").val($.cookie("user"));//用户名
  92. }
  93. $(".btns").click(function () {
  94. login();
  95. });
  96. $('input').bind('keypress', function (event) {
  97. if (event.keyCode == "13") {
  98. $('.btns').trigger("click");
  99. }
  100. });
  101. });
  102. /*点击提交*/
  103. function login() {
  104. var User = $("#user").val();
  105. var Password = $("#password").val();
  106. var userSeat = $("#userSeat").val();
  107. /*保存COOK*/
  108. //$.cookie("user", $("#user").val(),{expires: 7,secure:true});
  109. /*表单验证*/
  110. if (!User|| !Password) {
  111. $(".ts").addClass("Yz_error");
  112. if ($("#user").val() == "") {
  113. $("#user").focus(function () {
  114. $(".user_ts").removeClass("Yz_error");
  115. $(".password_ts").removeClass("Yz_error");
  116. $(this).parent().addClass("_success");
  117. });
  118. } else {
  119. $(".user_ts").addClass("Yz_success");
  120. }
  121. } else {
  122. /*请求后台*/
  123. $.ajax({
  124. type: "post",
  125. url: huayi.config.callcenter_url + "/Login/login",
  126. dataType: 'json',
  127. async: true,
  128. data: {
  129. username: User,
  130. extensionphone: userSeat,
  131. password: Password
  132. },
  133. success: function (data) {
  134. /*验证请求*/
  135. if (data.state == "success") {
  136. $.cookie("token", data.data.token, { expires: 7 });
  137. $.cookie("extno", userSeat, { expires: 7 });
  138. window.location.href = "index.html";
  139. } else {
  140. layer.msg("登录失败");
  141. }
  142. }
  143. });
  144. }
  145. }
  146. </script>
  147. </body>
  148. </html>