Michael Wang 6 роки тому
батько
коміт
2fc240e961
1 змінених файлів з 8 додано та 12 видалено
  1. 8 12
      public/index.html

+ 8 - 12
public/index.html

@@ -7,6 +7,7 @@
   <meta name="viewport" content="width=device-width,initial-scale=1.0">
   <link rel="icon" href="<%= BASE_URL %>favicon.ico">
   <title>网考学生端</title>
+  <script src="https://retcode.alicdn.com/retcode/bl.js" crossorigin=""></script>
   <script>
     // 重命名 Electron 提供的 require 详细请参考:https://www.w3cschool.cn/electronmanual/electronmanual-electron-faq.html
     if (typeof (require) != "undefined") {
@@ -18,18 +19,13 @@
   </script>
   <script src="https://ecs.qmth.com.cn:8878/electron-config/ali-arms.js"></script>
   <script>
-    if (window.__sampleRateInt) { // from above js file
-      startAliArms(window.__sampleRateInt);
-    } else {
-      startAliArms(100);
-    }
-    function startAliArms(sampleRate) {
-      console.log('ARMS sample: ' + sampleRate);
-      !(function (c, b, d, a) {
-        c[a] || (c[a] = {}); c[a].config = { pid: "hworw@48e147d26fd751a", enableSPA: true, sample: sampleRate, 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");
-    }
+    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, "", "__bl");
   </script>
 </head>