浏览代码

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

cc12458 2 周之前
父节点
当前提交
f20ffc541d
共有 1 个文件被更改,包括 6 次插入1 次删除
  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>