소스 검색

chore: 新增判断避免重复初始化全局支持匿名ID

zhangyuhan 5 달 전
부모
커밋
d8350c5567
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      src/web/staticres/common-module/public/head.js

+ 8 - 1
src/web/staticres/common-module/public/head.js

@@ -113,5 +113,12 @@
 
   }
 
-  // addMaticId();
+  if (document.cookie.indexOf('fid') === -1) {
+    try {
+      addMaticId()
+    } catch (e) {
+      console.log(e)
+    }
+  }
+
 })();