fix(route): 修复知乎分类热榜链接 (#9220)
* [FIX] fix zhihu url * fix: use parseDate utils Co-authored-by: Hongfei Zhou <hongfei.zhou@motiion.com>
This commit is contained in:
parent
3793781dff
commit
cdcb2e580b
|
|
@ -1,4 +1,5 @@
|
|||
const got = require('@/utils/got');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
|
||||
const titles = {
|
||||
total: '全站',
|
||||
|
|
@ -23,9 +24,9 @@ module.exports = async (ctx) => {
|
|||
});
|
||||
|
||||
const items = response.data.data.map((item) => ({
|
||||
link: item.target.url,
|
||||
link: `https://www.zhihu.com/question/${item.target.id}`,
|
||||
title: item.target.title,
|
||||
pubDate: new Date(item.target.created * 1000).toUTCString(),
|
||||
pubDate: parseDate(item.target.created * 1000),
|
||||
description: item.target.excerpt ? `<p>${item.target.excerpt}</p>` : '',
|
||||
}));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue