每日进入刷新缓存

This commit is contained in:
Paidax
2025-02-28 17:48:07 +08:00
parent a860f9699b
commit a9aa038a67
@@ -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 = []) { findParentNodes(data, targetHref, parents = []) {
for (const node of data) { for (const node of data) {
if (node && node.href === targetHref) { if (node && node.href === targetHref) {
@@ -540,6 +550,7 @@
created() { created() {
this.matchMenu() this.matchMenu()
this.getUnReadMsgNum() this.getUnReadMsgNum()
this.flushCache()
} }
}) })
</script> </script>