fix(route): yicai wrong pubDate (#7137)
This commit is contained in:
parent
5113c97a3d
commit
e6734345ee
|
|
@ -1,3 +1,4 @@
|
|||
const date = require('@/utils/date');
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
|
|
@ -15,11 +16,11 @@ module.exports = async (ctx) => {
|
|||
const resList = response.data;
|
||||
const item = resList.map((obj) => {
|
||||
const { datekey, istop, url, newcontent, hm, indexTitle } = obj;
|
||||
const dateStr = `${datekey.replace('.', '-')} ${hm}`;
|
||||
const dateStr = `${datekey.replace(/\./g, '-')} ${hm}`;
|
||||
return {
|
||||
title: indexTitle.length === newcontent.length ? indexTitle : `${indexTitle}...`,
|
||||
description: [istop ? '置顶:' : '', newcontent].filter((str) => !!str).join('<br/>'),
|
||||
pubDate: new Date(dateStr).toUTCString(),
|
||||
pubDate: date(dateStr, +8),
|
||||
link: `${baseUrl}${url}`,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue