Michael Wang пре 6 година
родитељ
комит
f329d52c56
1 измењених фајлова са 12 додато и 2 уклоњено
  1. 12 2
      src/plugins/axios.js

+ 12 - 2
src/plugins/axios.js

@@ -128,7 +128,12 @@ _$http.interceptors.request.use(
 // Add a response interceptor
 _$httpWith500Msg.interceptors.response.use(
   response => {
-    window._hmt.push(["_trackEvent", "网络请求-响应", response.config.url]);
+    window._hmt.push([
+      "_trackEvent",
+      `页面-${location.pathname}`,
+      "网络请求-响应",
+      new URL(response.config.url, "http://www.qmth.com.cn").pathname
+    ]);
     return response;
   },
   error => {
@@ -205,7 +210,12 @@ _$httpWith500Msg.interceptors.response.use(
 _$http.interceptors.response.use(
   // no auto 500 error UI
   response => {
-    window._hmt.push(["_trackEvent", "网络请求-响应", response.config.url]);
+    window._hmt.push([
+      "_trackEvent",
+      `页面-${location.pathname}`,
+      "网络请求-响应",
+      new URL(response.config.url, "http://www.qmth.com.cn").pathname
+    ]);
     return response;
   },
   error => {