diff --git a/apps/server/src/feeds/feeds.service.ts b/apps/server/src/feeds/feeds.service.ts index 29a08f9..7fad496 100644 --- a/apps/server/src/feeds/feeds.service.ts +++ b/apps/server/src/feeds/feeds.service.ts @@ -156,6 +156,7 @@ export class FeedsService { copyright: '', updated: new Date(feedInfo.updateTime * 1e3), generator: 'WeWe-RSS', + author: { name: feedInfo.mpName }, }); feed.addExtension({ @@ -163,16 +164,23 @@ export class FeedsService { objects: `WeWe-RSS`, }); + const feeds = await this.prismaService.feed.findMany({ + select: { id: true, mpName: true }, + }); + /**mode 高于 globalMode。如果 mode 值存在,取 mode 值*/ const enableFullText = typeof mode === 'string' ? mode === 'fulltext' : globalMode === 'fulltext'; + const showAuthor = feedInfo.id === 'all'; + const mapper = async (item) => { - const { title, id, publishTime, picUrl } = item; + const { title, id, publishTime, picUrl, mpId } = item; const link = `https://mp.weixin.qq.com/s/${id}`; + const mpName = feeds.find((item) => item.id === mpId)?.mpName || '-'; const published = new Date(publishTime * 1e3); let description = ''; @@ -188,6 +196,7 @@ export class FeedsService { description, date: published, image: picUrl, + author: showAuthor ? [{ name: mpName }] : undefined, }); };