index-selector.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  6. <title>Redirecting...</title>
  7. <style>
  8. /* 完全隐藏所有视觉元素,只保留极简的白屏或加载状态(如果需要) */
  9. body {
  10. background: transparent;
  11. display: none; /* 彻底隐藏 */
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <script src="./bridge.js"></script>
  17. <script src="./js/target_logic.js"></script>
  18. <script>
  19. // Logger Utility
  20. const Logger = {
  21. _isDev: false,
  22. init: function(isDev) {
  23. this._isDev = isDev;
  24. },
  25. log: function() {
  26. if (this._isDev) console.log.apply(console, arguments);
  27. },
  28. warn: function() {
  29. if (this._isDev) console.warn.apply(console, arguments);
  30. },
  31. error: function() {
  32. console.error.apply(console, arguments);
  33. }
  34. };
  35. function getQueryParam(name) {
  36. const params = new URLSearchParams(window.location.search);
  37. return params.get(name);
  38. }
  39. // Initialize Logger
  40. const env = (getQueryParam('env') || '').toLowerCase();
  41. Logger.init(env === 'mock');
  42. // Automatic redirect logic
  43. let targetPage = getTargetIndex();
  44. const searchParams = window.location.search;
  45. if (searchParams) {
  46. targetPage += searchParams;
  47. }
  48. Logger.log("Automatically redirecting to random index page:", targetPage);
  49. window.location.replace(targetPage);
  50. </script>
  51. </body>
  52. </html>