feat: 官网代码全量更新 (2026-04-18)

这个提交包含在:
wx
2026-04-18 15:13:28 +08:00
父节点 fcac8f88db
当前提交 f91ecbb093
共修改 135 个文件,包含 10307 行新增和 3349 行删除
+6 -1
查看文件
@@ -8,5 +8,10 @@ export default defineEventHandler(async (event) => {
const db = useDB()
const item = db.select().from(schema.stories).where(eq(schema.stories.id, id)).get()
if (!item) throw createError({ statusCode: 404, message: '故事不存在' })
return item
return {
...item,
tags: (() => { try { return JSON.parse(item.tags || '[]') } catch { return [] } })(),
sections: (() => { try { return JSON.parse(item.sections || '[]') } catch { return [] } })(),
keyMoments: (() => { try { return JSON.parse(item.keyMoments || '[]') } catch { return [] } })(),
}
})
+4
查看文件
@@ -19,6 +19,10 @@ export default defineEventHandler(async (event) => {
if (body.tripProduct !== undefined) updateData.tripProduct = body.tripProduct
if (body.travelDate !== undefined) updateData.travelDate = body.travelDate
if (body.coverImage !== undefined) updateData.coverImage = body.coverImage
if (body.summary !== undefined) updateData.summary = body.summary
if (body.author !== undefined) updateData.author = body.author
if (body.sourceUrl !== undefined) updateData.sourceUrl = body.sourceUrl
if (body.tags !== undefined) updateData.tags = Array.isArray(body.tags) ? JSON.stringify(body.tags) : body.tags
if (body.sections !== undefined) updateData.sections = JSON.stringify(body.sections)
if (body.keyMoments !== undefined) updateData.keyMoments = JSON.stringify(body.keyMoments)
if (body.seoTitle !== undefined) updateData.seoTitle = body.seoTitle