fix: 公告优化

This commit is contained in:
Gsh
2025-11-16 22:39:42 +08:00
parent f875617de1
commit 3c5e575e9b
4 changed files with 38 additions and 66 deletions

View File

@@ -37,11 +37,11 @@ export const useAnnouncementStore = defineStore(
const elapsed = now - closedAt.value;
if (closeType.value === 'permanent')
return false;
return true;
if (closeType.value === 'today') {
// 检查是否已过去一天24小时
return elapsed > 24 * 60 * 60 * 1000;
// 检查是否已过去一7天)
return elapsed > 7 * 24 * 60 * 60 * 1000;
}
return true;
@@ -72,7 +72,7 @@ export const useAnnouncementStore = defineStore(
},
{
persist: {
// 只持久化关闭状态相关的数据
// 只持久化关闭状态相关的数据,公告数据不缓存
paths: ['closeType', 'closedAt'],
},
},