Ver código fonte

只采集生产环境的前端监控数据

Michael Wang 6 anos atrás
pai
commit
84b6fc3049
1 arquivos alterados com 9 adições e 7 exclusões
  1. 9 7
      public/index.html

+ 9 - 7
public/index.html

@@ -22,13 +22,15 @@
 
 <body>
   <script>
-    window.__sampleRateInt = parseInt(window.__sampleRateInt) || 100
-    console.log('ARMS sample: ' + window.__sampleRateInt);
-    !(function (c, b, d, a) {
-      c[a] || (c[a] = {}); c[a].config = { pid: "hworw@48e147d26fd751a", enableSPA: true, sample: window.__sampleRateInt, sendResource: true, imgUrl: "https://arms-retcode.aliyuncs.com/r.png?" };
-      with (b) with (body) with (insertBefore(createElement("script"), firstChild))
-      setAttribute("crossorigin", "", src = d)
-    })(window, document, "https://retcode.alicdn.com/retcode/bl.js", "__bl");
+    if (location.host.includes('ecs.qmth.com.cn')) {
+      window.__sampleRateInt = parseInt(window.__sampleRateInt) || 100
+      console.log('ARMS sample: ' + window.__sampleRateInt);
+      !(function (c, b, d, a) {
+        c[a] || (c[a] = {}); c[a].config = { pid: "hworw@48e147d26fd751a", enableSPA: true, sample: window.__sampleRateInt, sendResource: true, imgUrl: "https://arms-retcode.aliyuncs.com/r.png?" };
+        with (b) with (body) with (insertBefore(createElement("script"), firstChild))
+        setAttribute("crossorigin", "", src = d)
+      })(window, document, "https://retcode.alicdn.com/retcode/bl.js", "__bl");
+    }
   </script>
 
   <div id="app"></div>