浏览代码

fix old client js compatibility

Michael Wang 5 年之前
父节点
当前提交
c980644aa2
共有 1 个文件被更改,包括 9 次插入7 次删除
  1. 9 7
      src/features/Login/Login.vue

+ 9 - 7
src/features/Login/Login.vue

@@ -220,13 +220,15 @@ export default {
     }
   },
   async created() {
-    window._hmt.push([
-      "_trackEvent",
-      "登录页面",
-      `当前网速: ${Number(navigator.connection.downlink).toPrecision(
-        1
-      )}Mib; 网络延迟: ${Number(navigator.connection.rrt).toPrecision(1)}ms`,
-    ]);
+    if (navigator.connection) {
+      window._hmt.push([
+        "_trackEvent",
+        "登录页面",
+        `当前网速: ${Number(navigator.connection.downlink).toPrecision(
+          1
+        )}Mib; 网络延迟: ${Number(navigator.connection.rrt).toPrecision(1)}ms`,
+      ]);
+    }
     if (this.isEPCC) {
       this.$Spin.show({
         render: () => {