伊川12345

login.html 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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">
  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="./Script/Common/huayi.load.js"></script>
  17. <script src="./Script/Common/huayi.config.js"></script>
  18. <script src="./js/jquery.md5.js"></script>
  19. </head>
  20. <body class="signin">
  21. <div class="signinpanel">
  22. <div class="d_left" style="width: 55%;">
  23. <div class="lg_boxs"> <img src="./img/lg.png" alt="" /></div>
  24. </div>
  25. <div class="d_right" style="width: 45%;">
  26. <form class="dl_form" method="get">
  27. <div class="hj_box"> <img class=" hj" src="./img/hj.png" alt="" /></div>
  28. <div class="user iut">
  29. <i class="i1 us"></i>
  30. <input type="text" placeholder="请输入管理账号" id="user">
  31. <i class="ts user_ts"></i>
  32. </div>
  33. <div class="fj iut">
  34. <i class="i1 yz"></i>
  35. <input type="text" placeholder="请输入分机号" id="fj">
  36. <i class="ts fj_ts"></i>
  37. </div>
  38. <div class="password iut">
  39. <i class="i1 ps"></i>
  40. <input type="password" placeholder="请输入密码" id="password">
  41. <i class="ts password_ts"></i>
  42. </div>
  43. <div class="b_box">
  44. <div class="btns" type="button">登录</div>
  45. </div>
  46. <h3 class="t_bootm">技术服务热线:400-637-1311</h3>
  47. </form>
  48. </div>
  49. </div>
  50. <script>
  51. $(function() {
  52. /*输入框样式改变*/
  53. $("#user").focus(function() {
  54. $(this).parent().addClass("_success");
  55. });
  56. $("#user").blur(function() {
  57. $(this).parent().removeClass("_success");
  58. })
  59. $("#fj").focus(function() {
  60. $(this).parent().addClass("_success");
  61. });
  62. $("#fj").blur(function() {
  63. $(this).parent().removeClass("_success");
  64. })
  65. $("#password").focus(function() {
  66. $(this).parent().addClass("_success");
  67. });
  68. $("#password").blur(function() {
  69. $(this).parent().removeClass("_success");
  70. });
  71. /*cook存储数据*/
  72. if($.cookie("username")) {
  73. //取值如果存在则赋值
  74. $("#user").val($.cookie("user")); //用户名
  75. $("#fj").val($.cookie("fj"));
  76. }
  77. $('input').bind('keypress', function(event) {
  78. if(event.keyCode == "13") {
  79. $(".btns").trigger("click");
  80. }
  81. });
  82. $(".btns").click(function() {
  83. var User = $("#user").val();
  84. var Fj = $("#fj").val();
  85. var Password = $("#password").val();
  86. /*保存COOK*/
  87. //$.cookie("user", $("#user").val(),{expires: 7,secure:true});
  88. //$.cookie("fj", $("#fj").val(), {expires: 7,secure:true});
  89. /*表单验证*/
  90. if(User == "" || Fj == "" || Password == "") {
  91. $(".ts").addClass("Yz_error");
  92. if($("#user").val() == "") {
  93. $("#user").focus(function() {
  94. $(".user_ts").removeClass("Yz_error");
  95. $(".fj_ts").removeClass("Yz_error");
  96. $(".password_ts").removeClass("Yz_error");
  97. $(this).parent().addClass("_success");
  98. });
  99. } else {
  100. $(".user_ts").addClass("Yz_success");
  101. }
  102. } else {
  103. /*请求后台*/
  104. $.ajax({
  105. type: "post",
  106. url: huayi.config.callcenter_url + "/Login/login",
  107. dataType: 'json',
  108. async: true,
  109. data: {
  110. username: User,
  111. extensionphone: Fj,
  112. password: $.md5(Password)
  113. },
  114. success: function(data) {
  115. /*验证请求*/
  116. if(data.state == "success") {
  117. $.cookie("token", data.data.token, {
  118. expires: 7
  119. });
  120. $.cookie("extno", Fj, {
  121. expires: 7
  122. });
  123. window.location.href = "index.html";
  124. }
  125. }
  126. });
  127. }
  128. });
  129. });
  130. /*点击提交*/
  131. /*cook*/
  132. </script>
  133. </body>
  134. </html>