fix(cms): 其余 9 套模板一并改读 publishTime,消除静默失效隐患
上一提交只改了 template-07(当时 cms_website.template_id = 7),其余模板 仍读已废弃的 projectTime、文章页仍写 publishTime || createTime。 由于 CaseItem 带索引签名,这些引用不报编译错误,只在换模板时静默显示 系统创建时间——而 template_id 是数据库里可随时改的数字,改它不需发版。 本次补全全部模板: - template-01..10 的 CaseDetail 改读 publishTime,标签更正为「发布时间」 - 其中 8 套原先没有 formatDate,一并补 dayjs 导入与格式化 (此前直出 2026-09-23 19:06:37 完整时间戳) - 文章侧 38 处 publishTime || createTime 统一为 publishTime - useModuleRoute 的 SEO datePublished 不再回退 createTime (结构化数据应与页面展示的发布时间一致) 保留 server/api/sitemap.xml.ts 的 lastmod 回退链——那是抓取提示不是页面 展示,回退到创建时间是合理的保守行为。 现在官网上已不存在读取 createTime 的内容页。ADR 0016 中记录的该技术债 已标记为消除。
This commit is contained in:
@@ -68,7 +68,10 @@ function injectDetailSeo(
|
||||
const keywords = Array.isArray(d?.tags)
|
||||
? d.tags.join(',')
|
||||
: (typeof d?.tags === 'string' ? d.tags : undefined)
|
||||
const publishedTime = d?.publishTime || d?.createTime || undefined
|
||||
// SEO 的 datePublished 用发布时间(运营可见的对外时间)。
|
||||
// 不回退 createTime:那是系统记录时间,与页面上展示的发布时间不一致时
|
||||
// 会让结构化数据与实际内容对不上(createTime 不对外展示,见 ADR 0016)。
|
||||
const publishedTime = d?.publishTime || undefined
|
||||
const modifiedTime = d?.updateTime || undefined
|
||||
|
||||
const origin = getOriginForSeo()
|
||||
|
||||
Reference in New Issue
Block a user