소스 검색

根据 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>