综合服务
This commit is contained in:
1 parent
91c96800b5
commit
67d72f9d35
3 files changed
+74
-2
No files matched your search
@@ -148,7 +148,15 @@ function hasValidDescription(desc: string | undefined | null) {
|
||||
|
||||
onMounted(async () => {
|
||||
const res = await getScreenNoticeList();
|
||||
noticeList.value = Array.isArray(res.data) ? res.data : [];
|
||||
// 过滤掉已过期的公告
|
||||
const now = new Date();
|
||||
noticeList.value = Array.isArray(res.data)
|
||||
? res.data.filter((notice: any) => {
|
||||
if (!notice.expireTime) return true; // 没有过期时间的公告始终显示
|
||||
const expireDate = new Date(notice.expireTime);
|
||||
return expireDate > now; // 只显示未过期的公告
|
||||
})
|
||||
: [];
|
||||
|
||||
// 获取失物招领数据
|
||||
const lostRes = await getScreenLostAndFoundList();
|
||||
|
||||
Reference in new issue
Block a user