Explorar o código

chore: 新增404异常上报,提高上报概率为 20%

zhangyuhan hai 1 ano
pai
achega
8119e57ed3

+ 26 - 0
src/web/staticres/micro/js/qiankun-common-functions.js

@@ -19,6 +19,12 @@ function getHasRouteMatched (router) {
   return hasRouteMatched
 }
 
+function sendNotFindPageError (content, options) {
+  if (window.Sentry && typeof window.Sentry.captureMessage === 'function') {
+    Sentry.captureMessage(content, options)
+  }
+}
+
 /**
  * 子应用 404 页面拦截
  * @param router
@@ -29,6 +35,17 @@ function addNotFindPage(router) {
     // vue-router相关路由,history.state中必有key
     var vueRouterHistory = history.state && history.state.key
     if (to.matched.length === 0 && vueRouterHistory) {
+      sendNotFindPageError(new Error('Error getHasRouteMatched beforeEach'), {
+        level: 'error',
+        tags: {
+          href: location.href
+        },
+        extra: {
+          router: router,
+          to: to,
+          from: from
+        }
+      })
       window.top.location.replace(notFindPage);
     } else {
       next();
@@ -36,6 +53,15 @@ function addNotFindPage(router) {
   });
 
   if (!getHasRouteMatched(router)) {
+    sendNotFindPageError(new Error('Error getHasRouteMatched'), {
+      level: 'error',
+      tags: {
+        href: location.href
+      },
+      extra: {
+        router: router
+      }
+    })
     window.top.location.replace(notFindPage);
   }
 }

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
src/web/staticres/public-pc/js/detection-min.js


+ 2 - 2
src/web/staticres/public-pc/js/detection.js

@@ -3,9 +3,9 @@
     try {
       Sentry.init({
         dsn: "https://ea0521e5b3584ca1879b940c165916e4@jysentry.jydev.jianyu360.cn/3",
-        release: "v4.8.7940",
+        release: "v4.9.351",
         environment: "produce",
-        sampleRate: 0.1
+        sampleRate: 0.2
       });
       Sentry.setTag("url", location.href);
       var id = document.cookie.match(/(^|;)\s*ud_safe\s*=\s*([^;]+)/);

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio