feat: 官网代码全量更新 (2026-04-18)
这个提交包含在:
@@ -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 [] } })(),
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
在新工单中引用
屏蔽一个用户