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:
@@ -6,7 +6,7 @@
|
||||
<h1 class="text-3xl sm:text-4xl font-bold text-[#1E2A47] mb-4">{{ caseItem.title }}</h1>
|
||||
<div class="flex flex-wrap items-center gap-4 text-sm text-[#666666] mb-8 pb-8 border-b border-[#E5E7EB]">
|
||||
<span v-if="caseItem.clientName" class="px-3 py-1 bg-[#FDECEC] text-[#CF1313] rounded-full">{{ caseItem.clientName }}</span>
|
||||
<span v-if="caseItem.projectTime">项目时间:{{ caseItem.projectTime }}</span>
|
||||
<span v-if="caseItem.publishTime">发布时间:{{ formatDate(caseItem.publishTime) }}</span>
|
||||
<span v-if="caseItem.categoryName">行业:{{ caseItem.categoryName }}</span>
|
||||
</div>
|
||||
<div v-if="caseItem.cover" class="rounded-2xl overflow-hidden mb-10 bg-[#F4F6FA] flex items-center justify-center">
|
||||
@@ -26,11 +26,17 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import dayjs from 'dayjs'
|
||||
import type { CaseItem } from '~/types'
|
||||
const route = useRoute()
|
||||
const id = route.params.id as string
|
||||
const { fileUrl } = useFileUrl()
|
||||
const { data: caseItem } = await useFetch<CaseItem | null>(`/api/case/detail?id=${id}`, { key: `case-${id}` })
|
||||
|
||||
function formatDate(date?: string) {
|
||||
if (!date) return ''
|
||||
return dayjs(date).format('YYYY-MM-DD')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user