From a9aa038a67512c7f58d4006ab78b0e2ab0149e30 Mon Sep 17 00:00:00 2001 From: Paidax Date: Fri, 28 Feb 2025 17:48:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=8F=E6=97=A5=E8=BF=9B=E5=85=A5=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/views/layouts/platform.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/resources/views/layouts/platform.html b/src/main/resources/views/layouts/platform.html index 838c00e..03123ce 100644 --- a/src/main/resources/views/layouts/platform.html +++ b/src/main/resources/views/layouts/platform.html @@ -77,7 +77,7 @@ - @@ -502,6 +502,16 @@ }); }, + async flushCache(){ + const day = moment().format('YYYY-MM-DD') + if (window.localStorage.getItem('flushCache') !== day) { + const {code, msg} = await $.post('/platform/home/clearCache') + if (code === 0) { + location.reload() + } + window.localStorage.setItem('flushCache', day) + } + }, findParentNodes(data, targetHref, parents = []) { for (const node of data) { if (node && node.href === targetHref) { @@ -540,6 +550,7 @@ created() { this.matchMenu() this.getUnReadMsgNum() + this.flushCache() } })