fix: 公告优化
This commit is contained in:
@@ -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'],
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user