fix: 政策详情接口添加content_html字段映射
详情接口返回的正文字段是body,前端期望content_html。 在_resolve_content_media后添加content_html = body映射,确保前端能正确渲染正文。
This commit is contained in:
@@ -158,6 +158,8 @@ async def opc_content_detail(
|
||||
await db.content.incr_read_count(content_id)
|
||||
item["read_count"] = (item.get("read_count") or 0) + 1
|
||||
item = _resolve_content_media(item)
|
||||
# 正文字段统一为 content_html(兼容前端)
|
||||
item["content_html"] = item.get("body", "")
|
||||
# 当前登录用户是否已点赞(未登录 false)
|
||||
item["liked_by_me"] = await db.content.is_liked(content_id, (user or {}).get("id", ""))
|
||||
return item
|
||||
|
||||
Reference in New Issue
Block a user