Browse Source

根据 mz 前缀判断是否启用代理

cc12458 2 tuần trước cách đây
mục cha
commit
f20ffc541d
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      production/report.html

+ 6 - 1
production/report.html

@@ -27,7 +27,12 @@
   <script>
     window.agency = {
       api: "https://api.reborn-tech.com",
-      oss: "https://taiyi.oss-cn-beijing.aliyuncs.com"
+      oss: "https://taiyi.oss-cn-beijing.aliyuncs.com",
+    }
+    const match = location.href.split('#')[0].match( /^(.*\/mz\/)(?:[^/]+\/)*[^/]+\.html/)
+    if (match != null) {
+      window.agency.api = match[1] + "api";
+      window.agency.oss = match[1] + "oss";
     }
   </script>
   <script type="module">!function(){try{new Function("m","return import(m)")}catch(o){console.warn("vite: loading legacy build because dynamic import is unsupported, syntax error above should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}}();</script>