From b81ee33b9e14026be015397cff2dae5263c5e746 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Thu, 19 Dec 2024 09:36:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=97=A5=E5=BF=97=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/pagespy.js | 4 +++- src/views/AuthApp.jsx | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/pagespy.js b/src/utils/pagespy.js index 60df3bf..dfb8889 100644 --- a/src/utils/pagespy.js +++ b/src/utils/pagespy.js @@ -1,4 +1,4 @@ -import { loadScript } from '@/utils/commons' +import { loadScript, readWebsocketLog } from '@/utils/commons' import { BUILD_VERSION, BUILD_DATE } from '@/config' export const loadPageSpy = (title) => { @@ -32,6 +32,7 @@ export const loadPageSpy = (title) => { // window.$harbor.upload({ clearCache: false, remark: '自动上传' }) // 上传日志 { clearCache: true, remark: '' } // }) window.onerror = async function (msg, url, lineNo, columnNo, error) { + await readWebsocketLog() // 上传最近 3 分钟的日志 const now = Date.now() await window.$harbor.uploadPeriods({ @@ -44,6 +45,7 @@ export const loadPageSpy = (title) => { } export const uploadPageSpyLog = async () => { + await readWebsocketLog() // window.$pageSpy.triggerPlugins('onOfflineLog', 'upload'); if (window.$pageSpy) { await window.$harbor.upload() // 上传日志 { clearCache: true, remark: '' } diff --git a/src/views/AuthApp.jsx b/src/views/AuthApp.jsx index 02355e6..661e1a3 100644 --- a/src/views/AuthApp.jsx +++ b/src/views/AuthApp.jsx @@ -101,7 +101,6 @@ function AuthApp() { } else { messageApi.error('Failure') } - clearWebsocketLog() } // 除了路由 /p...以外都需要登陆系统