5a7ad8de11
- OSS 文件存储(RustFS / S3 v4 兼容,零依赖手写 SigV4): 上传/列表/删除走桶 arcticnewone,/uploads 代理服务 + 本地回退; server/utils/sigv4.ts 纯函数 + AWS 测试向量验证 - 业务动态配置:settings 表 + /api/settings(公开) + /api/admin/settings(PATCH), useSiteSettings 组合式,footer/contact/tools/app.vue/侧边栏/工具页全部接入, 后台 /admin/settings 修改前台即时生效(站点/联系/社交/工具箱/页脚/SEO) - 后台全面优化:Admin* 设计系统(按钮/输入/表单/卡片/徽标/弹窗/确认/空态/骨架/ 分页/页头/Toast)14 组件;Dashboard 增强;各列表页搜索/筛选/批量删除/分页; 布局与侧边栏分组;统一 toast/确认反馈 - 个人中心全新重设计:顶部资料卡 + 统计、精致化改密/删号(二次确认)、 收藏封面网格、评论卡片、移动端适配 - deploy.sh 支持 OSS 凭据注入(NUXT_OSS_*);.env.example 更新 - 测试 17 例全过(含 SigV4 AWS 向量、settings 默认结构)
63 lines
2.2 KiB
Vue
Executable File
63 lines
2.2 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 { useSiteSettings } from '~/composables/useSiteSettings'
|
||
|
||
const { t } = useI18n()
|
||
const { settings, loc } = useSiteSettings()
|
||
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 = settings.value?.site.name || 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: settings.value?.site.name || t('app.name'),
|
||
alternateName: settings.value?.site.brand || '',
|
||
description: loc(settings.value?.site.description) || t('app.description'),
|
||
url: baseUrl || undefined,
|
||
logo: siteImage,
|
||
sameAs: (settings.value?.socials ?? []).map((s) => s.url),
|
||
}),
|
||
},
|
||
],
|
||
})
|
||
|
||
// 配置全局基础 SEO 和 Meta (取自后台动态配置,响应式国际化)
|
||
useSeoMeta({
|
||
description: () => loc(settings.value?.site.description) || t('app.description'),
|
||
keywords: () => loc(settings.value?.seo.keywords) || undefined,
|
||
ogTitle: () => settings.value?.site.name || t('app.name'),
|
||
ogDescription: () => loc(settings.value?.site.description) || t('app.description'),
|
||
ogImage: siteImage,
|
||
ogType: 'website',
|
||
twitterCard: 'summary_large_image',
|
||
twitterTitle: () => settings.value?.site.name || t('app.name'),
|
||
twitterDescription: () => loc(settings.value?.site.description) || t('app.description'),
|
||
twitterImage: siteImage,
|
||
})
|
||
</script>
|
||
|
||
<template>
|
||
<NuxtLayout>
|
||
<NuxtPage />
|
||
</NuxtLayout>
|
||
</template>
|