diff --git a/lib/routes/tencent/wechat/wemp.js b/lib/routes/tencent/wechat/wemp.js index 44a76301f8..27610d0b81 100644 --- a/lib/routes/tencent/wechat/wemp.js +++ b/lib/routes/tencent/wechat/wemp.js @@ -16,23 +16,32 @@ module.exports = async (ctx) => { const items = $('.post-item__main') .slice(0, 10) .get() - .map((e) => ({ - title: $(e) - .find('.post-item__title') - .text() - .trim(), - link: `https://wemp.app${$(e) - .find('.post-item__title') - .attr('href')}`, - pubDate: date( + .map((e) => { + let pubDate = date( `${year} ${$(e) .find('.post-item__date') .text() .trim()}`, 8 - ), - author, - })); + ); + + if (new Date(pubDate) > new Date()) { + pubDate = new Date(pubDate).setFullYear(year - 1); + pubDate = new Date(pubDate).toUTCString(); + } + + return { + title: $(e) + .find('.post-item__title') + .text() + .trim(), + link: `https://wemp.app${$(e) + .find('.post-item__title') + .attr('href')}`, + pubDate, + author, + }; + }); ctx.state.data = { title: `微信公众号 - ${author}`,