685c7b51d1
- 账号体系:修改密码(/account + PATCH /api/auth/password)、自助删除账号 (DELETE /api/auth/me)、订阅退订(token + /unsubscribe 页) - 前台/SEO:RSS 订阅 /feed.xml、作品详情分享、canonical URL、 文章 Article JSON-LD、品牌化错误页(i18n) - 后台增强:图片管理 /admin/uploads、操作审计日志 /admin/audit(含清空)、 联系消息已读标记、评论列表分页 - 工程:vitest 测试(密码哈希/内容校验器/种子完整性,12 例)+ pnpm test - DB 迁移:contacts.read、subscribers.token、audit_logs(老库 ALTER 兼容) - 密码逻辑抽为 server/utils/password.ts 供测试
61 lines
1.7 KiB
Vue
Executable File
61 lines
1.7 KiB
Vue
Executable File
<script setup lang="ts">
|
||
import { computed } from 'vue'
|
||
import { useHead, useSeoMeta, useRuntimeConfig, useRoute } from '#imports'
|
||
import { useI18n } from 'vue-i18n'
|
||
import { siteConfig } from '~/config/site'
|
||
|
||
const { t } = useI18n()
|
||
const { public: publicCfg } = useRuntimeConfig()
|
||
const route = useRoute()
|
||
const baseUrl = String(publicCfg.siteUrl || '').replace(/\/$/, '')
|
||
|
||
// 站点通用基础信息
|
||
const siteImage = baseUrl ? `${baseUrl}/og-image.png` : '/og-image.png'
|
||
|
||
// 配置全局 Title 模板 + canonical(SEO)
|
||
useHead({
|
||
titleTemplate: (titleChunk?: string) => {
|
||
const siteName = t('app.name')
|
||
return titleChunk ? `${titleChunk} - ${siteName}` : siteName
|
||
},
|
||
link: [
|
||
{ rel: 'canonical', href: computed(() => (baseUrl ? `${baseUrl}${route.path}` : undefined)) },
|
||
],
|
||
// JSON-LD 结构化数据(Organization)
|
||
script: [
|
||
{
|
||
type: 'application/ld+json',
|
||
innerHTML: JSON.stringify({
|
||
'@context': 'https://schema.org',
|
||
'@type': 'Organization',
|
||
name: t('app.name'),
|
||
alternateName: siteConfig.brandZh,
|
||
description: t('app.description'),
|
||
url: baseUrl || undefined,
|
||
logo: siteImage,
|
||
sameAs: siteConfig.socials.map((s) => s.url),
|
||
}),
|
||
},
|
||
],
|
||
})
|
||
|
||
// 配置全局基础 SEO 和 Meta (响应式支持国际化)
|
||
useSeoMeta({
|
||
description: () => t('app.description'),
|
||
ogTitle: () => t('app.name'),
|
||
ogDescription: () => t('app.description'),
|
||
ogImage: siteImage,
|
||
ogType: 'website',
|
||
twitterCard: 'summary_large_image',
|
||
twitterTitle: () => t('app.name'),
|
||
twitterDescription: () => t('app.description'),
|
||
twitterImage: siteImage,
|
||
})
|
||
</script>
|
||
|
||
<template>
|
||
<NuxtLayout>
|
||
<NuxtPage />
|
||
</NuxtLayout>
|
||
</template>
|