永城市12345 (县级市)- 来源于虞城县12345 - 所有县级统一API

login.html 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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. <script src="./Script/Common/huayi.load.js"></script>
  12. <script src="./Script/Common/huayi.config.js"></script>
  13. <link rel="stylesheet" href="./css/init.css" />
  14. <script src="./js/jquery.md5.js"></script>
  15. <style>
  16. html {
  17. margin: 0 auto;
  18. padding: 0;
  19. height: 100%;
  20. }
  21. body {
  22. height: 100%;
  23. background: #fff;
  24. }
  25. .wrap {
  26. width: 100%;
  27. height: 100%;
  28. }
  29. .wrap_left,
  30. .wrap_right {
  31. float: left;
  32. width: 50%;
  33. height: 100%;
  34. }
  35. .wrap_right{
  36. position: relative;
  37. }
  38. .wrap_left {
  39. background: url(img/left_amg_01.jpg) no-repeat;
  40. background-size: contain;
  41. }
  42. .tab_box {
  43. border: 1px solid #41caf2;
  44. border-top-right-radius: 15px;
  45. border-bottom-left-radius: 15px;
  46. margin: 50px auto 65px;
  47. padding: 0;
  48. overflow: hidden;
  49. width: 410px;
  50. }
  51. .tab_box ul {
  52. list-style: none;
  53. margin: 0;
  54. padding: 0;
  55. width: 100%;
  56. height: 50px;
  57. line-height: 50px;
  58. font-size: 16px;
  59. color: #41caf2;
  60. border-bottom: 1px solid #41caf2;
  61. text-align: center;
  62. }
  63. .tab_box ul li {
  64. width: 50%;
  65. float: left;
  66. }
  67. .active {
  68. background: #41caf2;
  69. color: #fff;
  70. }
  71. .tab_content {
  72. margin: 57px 0 35px 0;
  73. }
  74. .tab_content div p {
  75. width: 80%;
  76. margin: 0 auto;
  77. height: 35px;
  78. border: 1px solid #41caf2;
  79. border-radius: 15px;
  80. margin-bottom: 25px;
  81. line-height: 30px;
  82. padding-left: 20px;
  83. }
  84. .tab_content div p input {
  85. width: 75%;
  86. border: 0;
  87. font-size: 16px;
  88. outline: none;
  89. font-family: "仿宋", "宋体";
  90. }
  91. .login_icon {
  92. display: inline-block;
  93. width: 17px;
  94. height: 19px;
  95. vertical-align: middle;
  96. margin-right: 15px;
  97. }
  98. .login_icon_user {
  99. background: url(img/login_user.png) no-repeat;
  100. }
  101. .login_icon_lock {
  102. background: url(img/login_lock.png) no-repeat;
  103. }
  104. .login_icon_hua {
  105. background: url(img/login_hua.png) no-repeat;
  106. }
  107. .login_go {
  108. text-align: center;
  109. padding: 0!important;
  110. font-size: 16px;
  111. letter-spacing: 16px;
  112. font-family: "仿宋", "宋体";
  113. color: #fff;
  114. filter: progid:DXImageTransform.Microsoft.gradient(startcolorstr=#1f90ec, endcolorstr=#1cb5ef, gradientType=1);
  115. background: -webkit-gradient(li near, 0 0, 100% 0, from(#1f90ec), to(#1cb5ef));
  116. background: -webkit-linear-gradient(left, #1f90ec, #1cb5ef);
  117. background: -moz-linear-gradient(left, #1f90ec, #1cb5ef);
  118. background: -o-linear-gradient(left, #1f90ec, #1cb5ef);
  119. background: linear-gradient(left, #1f90ec, #1cb5ef);
  120. cursor: pointer;
  121. }
  122. .error {
  123. height: 13px;
  124. background: url(img/yz.png) no-repeat 0 -8px;
  125. display: none;
  126. }
  127. .errorShow {
  128. display: inline-block;
  129. }
  130. .rightCon{
  131. width: 100%;
  132. position: absolute;
  133. top: 0;
  134. bottom: 0;
  135. right: 0;
  136. left: 0;
  137. margin: auto;
  138. height: 580px;
  139. }
  140. .service{
  141. width: 100%;
  142. position: absolute;
  143. bottom: 30px;
  144. }
  145. </style>
  146. </head>
  147. <body class="signin">
  148. <div class="wrap clearfix">
  149. <div class="wrap_left ">
  150. </div>
  151. <div class="wrap_right">
  152. <div class="rightCon">
  153. <div class="logo" style="width: 100%;text-align: center;">
  154. <!--<i class="logo"></i><div class="logoWord"></div>-->
  155. <img src="img/sqLogo.png" alt="" />
  156. </div>
  157. <!--<div class="row clearfix">-->
  158. <div class="tab_box">
  159. <!--col-sm-7-->
  160. <ul class="clearfix tab_ul">
  161. <li class="active">坐席登录</li>
  162. <li>用户登录</li>
  163. </ul>
  164. <div class="tab_content">
  165. <div class="tab_one">
  166. <p>
  167. <i class="login_icon login_icon_user "></i>
  168. <input class="zx_user" type="text" placeholder="请输入您的管理账号" />
  169. <i class="login_icon error error_zx error_zx_user"></i>
  170. </p>
  171. <p>
  172. <i class="login_icon login_icon_hua "></i>
  173. <input class="zx_fj" type="text" placeholder="请输入分机号" />
  174. <i class="login_icon error error_zx error_zx_fj"></i>
  175. </p>
  176. <p>
  177. <i class="login_icon login_icon_lock "></i>
  178. <input class="zx_psw" type="password" placeholder="请输入您的密码" />
  179. <i class="login_icon error error_zx error_zx_psw"></i>
  180. </p>
  181. <p class="login_go login_zx">登录</p>
  182. </div>
  183. <div class="tab_two" style="display: none;">
  184. <p>
  185. <i class="login_icon login_icon_user "></i>
  186. <input class="gl_user" type="text" placeholder="请输入您的管理账号" />
  187. <i class="login_icon error error_gl error_gl_user"></i>
  188. </p>
  189. <p>
  190. <i class="login_icon login_icon_lock"></i>
  191. <input class="gl_psw" type="password" placeholder="请输入您的密码" />
  192. <i class="login_icon error error_gl error_gl_psw"></i>
  193. </p>
  194. <p class="login_go login_gl">登录</p>
  195. </div>
  196. </div>
  197. </div>
  198. <!--</div>-->
  199. <div class="service" >
  200. <!--row clearfix-->
  201. <!--<div class="col-sm-7">-->
  202. <p style="color: #313c58; font-size: 12px;text-align: center;"></p>
  203. <!--</div>-->
  204. </div>
  205. </div>
  206. </div>
  207. </div>
  208. <script>
  209. $(function() {
  210. var a=0;
  211. $('.tab_ul li').click(function() {
  212. $(this).addClass("active").siblings().removeClass("active");
  213. var index = $(this).index();
  214. a=index;
  215. $('.tab_content').children('div').eq(index).show().siblings().hide();
  216. })
  217. /*cook存储数据*/
  218. if($.cookie("username")) {
  219. //取值如果存在则赋值
  220. $(".gl_user").val($.cookie("user")); //用户名
  221. $("zx_fj").val($.cookie("fj"));
  222. $(".zx_user").val($.cookie("user"));
  223. }
  224. //键盘登录事件
  225. $('input').bind('keypress', function(event) {
  226. if(event.keyCode == "13") {
  227. if(a == 0) {
  228. $('.login_zx').trigger("click");
  229. } else {
  230. $(".login_gl").trigger("click");
  231. }
  232. }
  233. });
  234. //坐席登录
  235. $('.login_zx').click(function(){
  236. var zx_user = $(".zx_user").val();
  237. var zx_fj = $(".zx_fj").val();
  238. var zx_psw = $(".zx_psw").val();
  239. if(zx_user == "" || zx_fj == "" || zx_psw == "") {
  240. $(".error_zx").addClass('errorShow');
  241. if($(".zx_user").val() == "") {
  242. $(".zx_user").focus(function() {
  243. $(".error_zx").removeClass('errorShow');
  244. });
  245. } else {
  246. $(".error_zx_user").removeClass('errorShow');
  247. }
  248. }else {
  249. /*请求后台*/
  250. $.cookie("extno",zx_fj);
  251. $.cookie("zx_user",zx_user);
  252. $.ajax({
  253. type: "post",
  254. url: huayi.config.callcenter_url + "/Login/login",
  255. dataType: 'json',
  256. async: true,
  257. data: {
  258. username: zx_user,
  259. extensionphone: zx_fj,
  260. password: $.md5(zx_psw)
  261. },
  262. success: function(data) {
  263. /*验证请求*/
  264. if(data.state == "success") {
  265. $.cookie("token", data.data.token, {
  266. expires: 7
  267. });
  268. $.cookie("extno", zx_fj, {
  269. expires: 7
  270. });
  271. $.cookie("zx_user", zx_user, {
  272. expires: 7
  273. });
  274. window.location.href = "index.html";
  275. }
  276. //else {
  277. // $(".zx_user").val('');
  278. // $(".zx_fj").val('');
  279. // $(".zx_psw").val('');
  280. //}
  281. }
  282. });
  283. }
  284. })
  285. //用户登录
  286. $('.login_gl').click(function() {
  287. var gl_user = $(".gl_user").val();
  288. var gl_psw = $(".gl_psw").val();
  289. if(gl_user == "" || gl_psw == "") {
  290. $(".error_gl").addClass('errorShow');
  291. if($(".gl_user").val() == "") {
  292. $(".gl_user").focus(function() {
  293. $(".error_gl").removeClass('errorShow');
  294. });
  295. } else {
  296. $(".error_gl_user").removeClass('errorShow');
  297. }
  298. } else {
  299. /*请求后台*/
  300. $.ajax({
  301. type: "post",
  302. url: huayi.config.callcenter_url + "/Login/login",
  303. dataType: 'json',
  304. async: true,
  305. data: {
  306. username: gl_user,
  307. password: $.md5(gl_psw)
  308. },
  309. success: function(data) {
  310. /*验证请求*/
  311. if(data.state == "success") {
  312. $.cookie("token", data.data.token, {
  313. expires: 7
  314. });
  315. window.location.href = "index.html";
  316. }
  317. //else{
  318. // $(".gl_user").val('');
  319. // $(".gl_psw").val('');
  320. //}
  321. }
  322. });
  323. }
  324. })
  325. })
  326. </script>
  327. </body>
  328. </html>