Sin descripción

login.html 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <!DOCTYPE html>
  2. <html class="ui-page-login">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  6. <title></title>
  7. <link href="css/mui.css" rel="stylesheet" />
  8. <link href="css/iconfont.css" rel="stylesheet" />
  9. <link href="css/login.css" rel="stylesheet" />
  10. <script src="js/jquery.min.js"></script>
  11. <script src="Script/Common/huayi.http.js"></script>
  12. <script>
  13. var UserCode = helper.cookies.get("usercode");
  14. var UserType = helper.cookies.get("usertype");
  15. var UserName = helper.cookies.get("UserName");
  16. var rolename = helper.cookies.get("rolename");
  17. var State = helper.cookies.get("state");
  18. // alert(UserType)
  19. // 判断
  20. if(UserType){
  21. if(UserType == "0") { //分公司经理
  22. window.location.href = "client-side/client_index.html";
  23. } else if(UserType == "2") { //高层
  24. window.location.href = "client-side/high_list.html";
  25. } else if(UserType == "3") { //办理人员
  26. window.location.href = "client-side/Waiting_list.html";
  27. } else if(UserType == "4") { //业务员
  28. window.location.href = "client-side/Have_list.html";
  29. }
  30. }
  31. if(UserCode) {
  32. if(UserType == "0") { //分公司经理
  33. window.location.href = "client-side/client_index.html";
  34. } else if(UserType == "2") { //高层
  35. window.location.href = "client-side/high_list.html";
  36. } else if(UserType == "3") { //办理人员
  37. window.location.href = "client-side/Waiting_list.html";
  38. } else if(UserType == "4") { //业务员
  39. window.location.href = "client-side/Have_list.html";
  40. }
  41. }
  42. </script>
  43. </head>
  44. <body>
  45. <div class="mui-content">
  46. <form id='login-form' class="mui-input-group">
  47. <!--logo-->
  48. <div class="mui-logo-box">
  49. <div>
  50. <img src="img/logo.png" />
  51. </div>
  52. </div>
  53. <div class="mui-input-row">
  54. <label><span class="mui-icon iconfont icon-yonghu"></span></label>
  55. <input id='account' type="text" class="mui-input-clear mui-input" placeholder="请输入账号">
  56. </div>
  57. <div class="mui-input-row mui-password">
  58. <label><span class="mui-icon iconfont icon-suo"></span></label>
  59. <input id='password' type="password" class=" mui-input-password mui-input" placeholder="请输入密码">
  60. </div>
  61. </form>
  62. <div class="mui-content-padded">
  63. <button id='login' class="mui-btn mui-btn-block mui-btn-primary" style="font-size: 16px;">登录</button>
  64. </div>
  65. <div class="mui-content-padded oauth-area">
  66. <a class="reg_href" style="">心连心化学工业集团</a>
  67. </div>
  68. </div>
  69. <script src="js/mui.min.js"></script>
  70. <script src="Script/Common/huayi.config.js"></script>
  71. <script>
  72. var openid = helper.cookies.get("openid");
  73. var UserType = helper.cookies.get("usertype");
  74. // var type = helper.request.queryString("type");
  75. var openid = "oXF5e1mWpX5DajW5_yjNLPKb8ThE";
  76. //登陆验证
  77. $("#login").on('tap', function() {
  78. if(!$("#account").val()) {
  79. mui.alert("请输入账号");
  80. return;
  81. }
  82. if(!$("#password").val()) {
  83. mui.alert("密码不能为空")
  84. return;
  85. }
  86. //请求
  87. $.ajax({
  88. type: "post",
  89. url: huayi.config.callcenter_url + 'WxLogin/Login',
  90. async: true,
  91. dataType: 'json',
  92. data: {
  93. UserCode: $("#account").val(),
  94. Password: $("#password").val(),
  95. UserType:1,
  96. State:1,
  97. openid: openid,
  98. //openid: 'oXF5e1mWpX5DajW5_yjNLPKb8ThE', //微信openid 测试用
  99. },
  100. success: function(data) {
  101. // debugger
  102. if(data.state == "success") {
  103. debugger
  104. var UserType = data.data.usertype;
  105. var UserCode = data.data.usercode;
  106. var UserName = data.data.UserName;
  107. var rolename = data.data.rolename;
  108. var UserCode = data.data.usercode;
  109. helper.cookies.set("usercode", data.data.usercode, 7);
  110. helper.cookies.set("usertype", data.data.usertype, 7);
  111. helper.cookies.set("userword", $("#password").val(), 7);
  112. helper.cookies.set("UserName", data.data.UserName, 7);
  113. helper.cookies.set("rolename", data.data.rolename, 7);
  114. helper.cookies.set("area", data.data.area, 7);
  115. helper.cookies.set("offic", data.data.offic, 7);
  116. helper.cookies.set("region", data.data.region, 7);
  117. helper.cookies.set("openid", 'oXF5e1mWpX5DajW5_yjNLPKb8ThE', 7);//微信openid 测试用
  118. if(UserType == "0") { //分公司经理,大区经理
  119. window.location.href = "client-side/client_index.html";
  120. } else if(UserType == "2") { //高层
  121. window.location.href = "client-side/high_list.html";
  122. } else if(UserType == "3") { //办理人员
  123. window.location.href = "client-side/Waiting_list.html";
  124. } else if(UserType == "4") { //业务员
  125. window.location.href = "client-side/Have_list.html?v=0.1";
  126. } else {
  127. window.location.href = "client-side/client_index.html";
  128. }
  129. } else {
  130. mui.alert(data.message);
  131. }
  132. }
  133. })
  134. })
  135. </script>
  136. </body>
  137. </html>