From 2abdc6ccafe0c71922dfd66ec8834fb770955f8a Mon Sep 17 00:00:00 2001 From: Lei OT Date: Wed, 25 Dec 2024 11:50:26 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=B8=8A=E4=BC=A0=E6=9C=80=E8=BF=91=20?= =?UTF-8?q?1=20=E5=B0=8F=E6=97=B6=E7=9A=84=E6=97=A5=E5=BF=97,=20=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5upload=20=E6=89=80=E6=9C=89=E6=97=A5=E5=BF=97:=20413?= =?UTF-8?q?=20Payload=20Too=20Large?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AuthApp.jsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/views/AuthApp.jsx b/src/views/AuthApp.jsx index ea8e0ff..666892c 100644 --- a/src/views/AuthApp.jsx +++ b/src/views/AuthApp.jsx @@ -89,10 +89,20 @@ function AuthApp() { await readWebsocketLog() if (window.$pageSpy) { // window.$pageSpy.triggerPlugins('onOfflineLog', 'upload') - await window.$harbor.upload() // 上传日志 { clearCache: true, remark: '' } - messageApi.info('Success') - clearWebsocketLog() - sendNotify() + try { + // await window.$harbor.upload() // 上传日志 { clearCache: true, remark: '' } + // 上传最近 1 小时的日志, 直接upload 所有日志: 413 Payload Too Large + const now = Date.now() + await window.$harbor.uploadPeriods({ + startTime: now - 60 * 60000, + endTime: now, + }) + messageApi.info('Success') + clearWebsocketLog() + sendNotify() + } catch (error) { + messageApi.error('Failure') + } } else { messageApi.error('Failure') }