|
|
|
@ -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: '' }
|
|
|
|
|