diff --git a/write-server/src/app/api/rss/wechat/route.ts b/write-server/src/app/api/rss/wechat/route.ts index 8c8914c8..babad953 100644 --- a/write-server/src/app/api/rss/wechat/route.ts +++ b/write-server/src/app/api/rss/wechat/route.ts @@ -118,14 +118,24 @@ export async function POST(request: NextRequest) { const rawContent = (a.content as string) || ""; const { html, imageUrls } = mdToWechatHtml(rawContent, slug); - const result: Record = { - title: a.title, - author: a.author, + const result: { + title: string; + author: string; + content: string; + content_source_url?: string; + thumb_media_url?: string; + thumb_media_id?: string; + show_cover_pic: number; + need_open_comment: number; + content_image_urls?: { original_url: string }[]; + } = { + title: String(a.title || ""), + author: String(a.author || ""), content: html, - content_source_url: a.content_source_url, - thumb_media_url: a.thumb_media_url, - show_cover_pic: a.show_cover_pic ?? 1, - need_open_comment: a.need_open_comment ?? 0, + content_source_url: a.content_source_url as string | undefined, + thumb_media_url: a.thumb_media_url as string | undefined, + show_cover_pic: (a.show_cover_pic as number) ?? 1, + need_open_comment: (a.need_open_comment as number) ?? 0, }; if (imageUrls.length > 0) { @@ -135,7 +145,7 @@ export async function POST(request: NextRequest) { return result; }); - const result = await syncWechat(processedArticles); + const result = await syncWechat(processedArticles as any); return NextResponse.json(result); } catch (error: unknown) { const msg = error instanceof Error ? error.message : "Unknown error";