Bez popisu

login.html 6.2KB

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