浏览代码

:rotating_light:

Vanessa 2 年之前
父节点
当前提交
710e703867
共有 2 个文件被更改,包括 4 次插入3 次删除
  1. 1 1
      app/src/types/index.d.ts
  2. 3 2
      app/src/util/onGetConfig.ts

+ 1 - 1
app/src/types/index.d.ts

@@ -26,7 +26,7 @@ type TBazaarType = "templates" | "icons" | "widgets" | "themes"
 declare module "blueimp-md5"
 
 interface Window {
-    dataLayer: string[]
+    dataLayer: any[]
     siyuan: ISiyuan
     webkit: any
 

+ 3 - 2
app/src/util/onGetConfig.ts

@@ -164,8 +164,9 @@ export const onGetConfig = (isStart: boolean) => {
     if (!window.siyuan.config.system.disableGoogleAnalytics) {
         try {
             window.dataLayer = window.dataLayer || [];
-            // @ts-ignore
-            window.gtag = () => {window.dataLayer.push(arguments)};
+            window.gtag = function (...args) {
+                window.dataLayer.push(args);
+            };
             window.gtag("js", new Date());
             window.gtag("config", "G-L7WEXVQCR9");
             const para = {