diff --git a/lib/routes/aiyanxishe/home.js b/lib/routes/aiyanxishe/home.js index 114021525c..4043c56339 100644 --- a/lib/routes/aiyanxishe/home.js +++ b/lib/routes/aiyanxishe/home.js @@ -27,17 +27,20 @@ module.exports = async (ctx) => { }, }); - const ProcessFeed = (type, data) => { + const ProcessFeed = (type, data, id) => { let description = ''; let author = ''; + let link; switch (type) { case 'blog': // 博客 description = data.content; author = data.user.nickname; + link = `https://ai.yanxishe.com/page/blogDetail/${id}`; break; case 'question': // 问答 description = data.content; author = data.user.nickname; + link = `https://ai.yanxishe.com/page/questionDetail/${id}`; break; case 'article': // 翻译 description = ``; @@ -57,6 +60,7 @@ module.exports = async (ctx) => { } `; author = data.user.nickname; + link = `https://ai.yanxishe.com/page/TextTranslation/${id}`; break; case 'paper': // 论文 description = `

标题

${data.paper.title}

`; @@ -66,6 +70,7 @@ module.exports = async (ctx) => { description += `

摘要

${data.paper.description}

`; description += `

推荐理由

${data.paper.userInfo.nickname} : ${data.paper.recommend_reason}

`; author = data.paper.userInfo.nickname; + link = `https://ai.yanxishe.com/page/paperDetail/${id}`; break; default: description = '暂不支持此类型,请到 https://github.com/DIYgod/RSSHub/issues 反馈'; @@ -73,7 +78,7 @@ module.exports = async (ctx) => { } // 提取内容 - return { author, description }; + return { author, description, link }; }; const items = await Promise.all( @@ -95,13 +100,13 @@ module.exports = async (ctx) => { url: itemUrl, }); - const result = ProcessFeed(item.type, response.data.data); + const result = ProcessFeed(item.type, response.data.data, item.id); const single = { title: item.zh_title, description: result.description, pubDate: new Date(parseFloat(item.published_time + '000')).toUTCString(), - link: itemUrl, + link: result.link, author: result.author, }; ctx.cache.set(itemUrl, JSON.stringify(single));
${data.title} ${data.zh_title}