diff --git a/lib/routes/yicai/brief.js b/lib/routes/yicai/brief.js index 80bf58680ce90c..deba8af66889f7 100644 --- a/lib/routes/yicai/brief.js +++ b/lib/routes/yicai/brief.js @@ -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('
'), - pubDate: new Date(dateStr).toUTCString(), + pubDate: date(dateStr, +8), link: `${baseUrl}${url}`, }; });