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...以外都需要登陆系统