fix(route): xiaoheihe news duplicate entries (#6992)

This commit is contained in:
hoilc 2021-02-23 08:01:32 +08:00 committed by GitHub
parent b72f8778d6
commit fa5e993d1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,8 @@ module.exports = async (ctx) => {
const news = {
title: item.title,
pubDate: item.data,
link: item.newUrl,
link: `https://api.xiaoheihe.cn/maxnews/app/share/detail/${newsId}`,
guid: cacheKey,
};
// 判断缓存中是否存在
@ -38,7 +39,6 @@ module.exports = async (ctx) => {
// 存放到缓存区
ctx.cache.set(cacheKey, content);
news.description = content;
news.link = `https://api.xiaoheihe.cn/maxnews/app/share/detail/${newsId}`;
}
return Promise.resolve(news);