moniAd.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <!DOCTYPE html>
  2. <html class="remModel">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="Content-Type" content="application/xhtml+xml;charset=UTF-8">
  6. <meta http-equiv="Cache-Control" content="no-cache,no-store,must-revalidate">
  7. <meta http-equiv="pragma" content="no-cache">
  8. <meta http-equiv="expires" content="0">
  9. <meta name="format-detection" content="telephone=no,email=no">
  10. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
  11. <title></title>
  12. <style>
  13. html {
  14. width: 100%;
  15. height: 100%;
  16. }
  17. body {
  18. width: 100%;
  19. height: 100%;
  20. margin: 0;
  21. color: #fff;
  22. background-image: linear-gradient(to top, #48c6ef 0%, #6f86d6 100%);
  23. }
  24. a {
  25. position: fixed;
  26. top: 50%;
  27. left: 50%;
  28. transform: translateX(-50%) translateY(-50%);
  29. color: #fff;
  30. text-decoration: none;
  31. border: 1px solid #fff;
  32. line-height: 40px;
  33. border-radius: 20px;
  34. padding: 0 20px;
  35. white-space: nowrap;
  36. }
  37. </style>
  38. </head>
  39. <body class="">
  40. <a href="javascript:goPage()" id="btn">
  41. 请稍候...
  42. </a>
  43. <script>
  44. // 此页面尽量不引入任何css和js,加快反应速度
  45. function getQueryString(name) {
  46. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  47. var r = window.location.search.substr(1).match(reg);
  48. if (r != null)
  49. return decodeURI(r[2]);
  50. return null;
  51. }
  52. var userPageRedirect = getQueryString("userPageRedirect");//步骤1,前台的原页面
  53. var serverRedirect = location.pathname + location.hash;// 步骤2,后台鉴权完成后先跳到本页面
  54. var btn = document.getElementById('btn');
  55. // 前台先跳到本页面进行鉴权,因为IOS 在VUE鉴权太慢
  56. if (userPageRedirect) {
  57. btn.innerHTML = '微信正在鉴权,请稍候'
  58. sessionStorage.setItem("USER_PAGE_REDIRECT", userPageRedirect);
  59. location.href = "/user/moniUserAccess?redirect=" + serverRedirect;
  60. } else {
  61. btn.innerHTML = '√ 鉴权完成,点击跳转 ☜'
  62. goPage()
  63. }
  64. function goPage() {
  65. // 后台鉴权后再跳到次页面,然后根据本地缓存的地址进行跳转,本次会话有效
  66. var userPageRedirectSaved = sessionStorage.getItem("USER_PAGE_REDIRECT");
  67. if (userPageRedirectSaved) {
  68. location.href = decodeURIComponent(userPageRedirectSaved);
  69. } else {
  70. alert('目标页面未找到,您可以从公众号重新进入,或是直接扫码使用设备')
  71. }
  72. }
  73. </script>
  74. </body>
  75. </html>