Przeglądaj źródła

1、添加应用监控代码

dongpo 1 rok temu
rodzic
commit
e735fe6d62
1 zmienionych plików z 24 dodań i 0 usunięć
  1. 24 0
      public/index.html

+ 24 - 0
public/index.html

@@ -5,9 +5,33 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="renderer" content="webkit">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+    <meta name="wpk-bid" content="dta_2_139020">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title><%= webpackConfig.name %></title>
     <script src="https://g.alicdn.com/dingding/dingtalk-jsapi/2.0.57/dingtalk.open.js"></script>
+    <!--  微应用监控  -->
+    <script>
+      var isDingtalk = navigator && /DingTalk/.test(navigator.userAgent);
+      var isProductEnv = window && window.location && window.location.host
+        && window.location.host.indexOf('127.0.0.1') === -1
+        && window.location.host.indexOf('localhost') === -1
+        && window.location.host.indexOf('192.168.') === -1
+      // 如果有其它测试域名,请一起排掉,减少测试环境对生产环境监控的干扰
+      if (isProductEnv) {
+        !(function (c, i, e, b) {
+          var h = i.createElement("script");
+          var f = i.getElementsByTagName("script")[0];
+          h.type = "text/javascript";
+          h.crossorigin = true;
+          h.onload = function () {
+            c[b] || (c[b] = new c.wpkReporter({bid: "dta_2_139020"}));
+            c[b].installAll()
+          };
+          f.parentNode.insertBefore(h, f);
+          h.src = e
+        })(window, document, "https://g.alicdn.com/woodpeckerx/jssdk??wpkReporter.js", "__wpk");
+      }
+    </script>
     <!--[if lt IE 11]><script>window.location.href='html/ie.html';</script><![endif]-->
     <style>
     html,