Эх сурвалжийг харах

全局Promise未处理错误: 记录错误所在页面

Michael Wang 6 жил өмнө
parent
commit
8850ab3426
1 өөрчлөгдсөн 6 нэмэгдсэн , 1 устгасан
  1. 6 1
      src/utils/monitors.js

+ 6 - 1
src/utils/monitors.js

@@ -64,7 +64,12 @@ window.addEventListener("unhandledrejection", function(event) {
   //     }
   //   }
   // );
-  window._hmt.push(["_trackEvent", "全局Promise未处理错误", event.reason]);
+  window._hmt.push([
+    "_trackEvent",
+    "全局Promise未处理错误",
+    location.href,
+    event.reason,
+  ]);
 });
 
 window.addEventListener("rejectionhandled", function(event) {