Bez popisu

login.html 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <!DOCTYPE html>
  2. <html lang="zh-CN" 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.min.css" rel="stylesheet" />
  8. <link href="css/login.css" rel="stylesheet" />
  9. </head>
  10. <body>
  11. <div class="mui-content">
  12. <div class="mui-box">
  13. <div class="img_box">
  14. </div>
  15. <form class="mui-input-group">
  16. <div class="mui-input-row" style="text-align: center; font-size: 20px;">
  17. <span>管理员登录</span>
  18. </div>
  19. <div class="mui-input-row">
  20. <label>账号</label>
  21. <input id='account' type="text" class="mui-input-clear mui-input" placeholder="请输入账号">
  22. </div>
  23. <div class="mui-input-row">
  24. <label>密码</label>
  25. <input id='password' type="password" class="mui-input-clear mui-input" placeholder="请输入密码">
  26. </div>
  27. </form>
  28. <div class="mui-content-padded ">
  29. <button id='login' class="mui-btn mui-btn-block mui-btn-primary">登录</button>
  30. </div>
  31. </div>
  32. </div>
  33. <script src="js/zepto.js"></script>
  34. <script src="js/mui.min.js"></script>
  35. <script src="Script/Common/huayi.config.js"></script>
  36. <script src="Script/Common/huayi.http.js"></script>
  37. <script>
  38. var openid = helper.cookies.get("openid");
  39. var type = helper.request.queryString("type");
  40. //登陆验证
  41. $("#login").on('tap', function() {
  42. if(!$("#account").val()) {
  43. mui.alert("请输入账号");
  44. return;
  45. }
  46. if(!$("#password").val()) {
  47. mui.alert("密码不能为空")
  48. return;
  49. }
  50. //请求
  51. $.ajax({
  52. type: "post",
  53. url: huayi.config.callcenter_url + 'WxLogin/Login',
  54. async: true,
  55. dataType: 'json',
  56. data: {
  57. UserCode: $("#account").val(),
  58. Password: $("#password").val(),
  59. openid: openid,
  60. //openid: 'oKOqcvw24ZMtsRKlpjBFKHAWuDmI', //微信openid 测试用
  61. //API地址: http://117.158.196.116:4000/zentao/doc-view-79.html
  62. },
  63. success: function(data) {
  64. if(data.state == "success") {
  65. helper.cookies.set("usercode", $("#account").val(), 7);
  66. //helper.cookies.set("openid", 'oKOqcvw24ZMtsRKlpjBFKHAWuDmI', 7);//微信openid 测试用
  67. if(type === "1") {//高级管理》》数据统计
  68. window.location.href = "index.html?menuCode=SJTJ";
  69. } else if(type === "3") {//个人中心
  70. window.location.href = "index.html?menuCode=GRZX";
  71. }else{//高级管理》》信息处理
  72. window.location.href = "index.html?menuCode=XXCL";
  73. }
  74. } else {
  75. mui.alert(data.message);
  76. }
  77. }
  78. })
  79. })
  80. </script>
  81. </body>
  82. </html>