feat: 按发布时间倒序排列AI推荐结果
This commit is contained in:
@@ -224,10 +224,18 @@ const fetchAIRecommendations = async () => {
|
||||
title: rec.title,
|
||||
url: bid?.url || '',
|
||||
source: bid?.source || '',
|
||||
confidence: rec.confidence
|
||||
confidence: rec.confidence,
|
||||
publishDate: bid?.publishDate
|
||||
}
|
||||
})
|
||||
|
||||
// 按发布时间倒序排列
|
||||
recommendations.sort((a: AIRecommendation, b: AIRecommendation) => {
|
||||
if (!a.publishDate) return 1
|
||||
if (!b.publishDate) return -1
|
||||
return new Date(b.publishDate).getTime() - new Date(a.publishDate).getTime()
|
||||
})
|
||||
|
||||
aiRecommendations.value = recommendations
|
||||
|
||||
// 保存推荐结果到数据库
|
||||
|
||||
Reference in New Issue
Block a user