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:
@@ -219,7 +219,7 @@
|
||||
<p class="text-sm text-[var(--t10-muted-2)] t10-clamp-2 mb-4">
|
||||
{{ summaryOf(item) }}
|
||||
</p>
|
||||
<span class="text-xs text-[var(--t10-muted)]">{{ formatDate(item.publishTime || item.createTime) }}</span>
|
||||
<span class="text-xs text-[var(--t10-muted)]">{{ formatDate(item.publishTime) }}</span>
|
||||
</div>
|
||||
</NuxtLink>
|
||||
</div>
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
{{ article.title }}
|
||||
</h1>
|
||||
<div class="flex flex-wrap items-center gap-4 text-sm text-[var(--t10-muted-2)] mb-8 pb-6 border-b border-[var(--t10-border)]">
|
||||
<span v-if="article.publishTime || article.createTime">
|
||||
发布时间:{{ formatDate(article.publishTime || article.createTime) }}
|
||||
<span v-if="article.publishTime">
|
||||
发布时间:{{ formatDate(article.publishTime) }}
|
||||
</span>
|
||||
<span v-if="article.author">作者:{{ article.author }}</span>
|
||||
<span v-if="article.source">来源:{{ article.source }}</span>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<p class="text-sm text-[var(--t10-muted-2)] t10-clamp-2 mb-4 min-h-[40px]">
|
||||
{{ summaryOf(item) }}
|
||||
</p>
|
||||
<span class="text-xs text-[var(--t10-muted)]">{{ formatDate(item.publishTime || item.createTime) }}</span>
|
||||
<span class="text-xs text-[var(--t10-muted)]">{{ formatDate(item.publishTime) }}</span>
|
||||
</div>
|
||||
</NuxtLink>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user