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:
hongfei 2022-02-28 20:30:45 -05:00 committed by GitHub
parent 3793781dff
commit cdcb2e580b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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>` : '',
}));