fix(route): zhihu/topic add type of the article (#8953)
This commit is contained in:
parent
f4abc22dcb
commit
a8fdec6621
|
|
@ -1,5 +1,6 @@
|
|||
const got = require('@/utils/got');
|
||||
const utils = require('./utils');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const { topicId } = ctx.params;
|
||||
|
|
@ -32,7 +33,7 @@ module.exports = async (ctx) => {
|
|||
title = `${item.question.title}-${item.author.name}的回答:${item.excerpt}`;
|
||||
description = `<strong>${item.question.title}</strong><br>${item.author.name}的回答<br/>${utils.ProcessImage(item.content)}`;
|
||||
link = `https://www.zhihu.com/question/${item.question.id}/answer/${item.id}`;
|
||||
pubDate = new Date(item.updated_time * 1000).toUTCString();
|
||||
pubDate = parseDate(item.updated_time * 1000);
|
||||
author = item.author.name;
|
||||
break;
|
||||
|
||||
|
|
@ -40,7 +41,14 @@ module.exports = async (ctx) => {
|
|||
title = item.title;
|
||||
description = item.title;
|
||||
link = `https://www.zhihu.com/question/${item.id}`;
|
||||
pubDate = new Date(item.created * 1000).toUTCString();
|
||||
pubDate = parseDate(item.created * 1000);
|
||||
break;
|
||||
|
||||
case 'article':
|
||||
title = item.title;
|
||||
description = item.content;
|
||||
link = item.url;
|
||||
pubDate = parseDate(item.created * 1000);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in New Issue