商丘12345 前端

appindex.html 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>首页</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <link rel="stylesheet" href="layui/css/layui.mobile.css" />
  10. </head>
  11. <body>
  12. <script src="layui/layui.js"></script>
  13. <script src="js/zepto.js"></script>
  14. <script src="Script/Common/huayi.config.js"></script>
  15. <script src="Script/Common/huayi.http.js"></script>
  16. <script type="text/javascript">
  17. var openid = helper.cookies.get("openid");
  18. var usercode = helper.request.queryString("usercode");
  19. var signcode = helper.request.queryString("signcode");
  20. var menucode = helper.request.queryString("menucode");
  21. if (!openid) {
  22. if (usercode && signcode) {
  23. $.ajax({
  24. type: "get",
  25. url: huayi.config.callcenter_url + 'WxLogin/GetZWWUser',
  26. async: false,
  27. data: { usercode: usercode, signcode: signcode },
  28. dataType: 'json',
  29. success: function (data) {
  30. if (data.state.toLowerCase() == "success") {
  31. helper.cookies.set("openid", data.data, 7);
  32. if (!helper.cookies.get("openid")) {
  33. window.location.replace("html/error.html?r=" + Math.random());
  34. }
  35. gourl();
  36. }
  37. }
  38. });
  39. }
  40. }
  41. else {
  42. gourl();
  43. }
  44. function gourl() {
  45. switch (menucode.toLowerCase()) {
  46. case "add": window.location.replace("html/mytousu.html?menuCode=WYTS&r=" + Math.random()); break;
  47. case "list": window.location.replace("html/allsuqiu.html?r=" + Math.random()); break;
  48. default: window.location.replace("html/error.html?r=" + Math.random()); break;
  49. }
  50. }
  51. </script>
  52. </body>
  53. </html>