Files
BYW-VoiceHub/app/components/SiteFooter.vue
T
Henry_Du a82ff6747e
构建并部署 BYW VoiceHub / Preflight 语法与构建检查 (push) Successful in 2m8s
构建并部署 BYW VoiceHub / 构建并推送容器镜像 (push) Successful in 9m11s
构建并部署 BYW VoiceHub / 部署到生产服务器 (push) Successful in 7s
feat(site): 对齐参考站点UI与交互调整
- 页脚:响应耗时文字统一为「响应耗时 XXXms」,版本链接改为 GitHub 官方仓库,默认 ICP 备案号设置为粤ICP备2025450093号
- 顶部栏:恢复主题切换按钮与语言按钮(语言暂为占位提示),放置于用户区左侧
- 主题:修复首屏内联脚本默认主题白名单校验,避免 localStorage 中残留的 light/dark/System 等非法值生效,首屏默认改为 ClassicLight(仅允许 ClassicLight/ModernLight)
- 登录页:在密码输入框下方恢复「忘记密码?」入口,新增配套的找回密码引导页 /forgot-password
- 默认配置:system-settings 兜底记录与 SYSTEM_SETTINGS_DEFAULTS 新增 icpNumber 默认值
2026-09-12 11:56:30 +08:00

180 lines
4.1 KiB
Vue

<template>
<div class="site-footer">
<div class="footer-info">
<span v-if="icpNumber" class="footer-item">
<a
:href="`https://beian.miit.gov.cn/`"
class="icp-link"
rel="noopener noreferrer"
target="_blank"
>
{{ icpNumber }}
</a>
</span>
<span v-if="gonganNumber" class="footer-item">
<a
:href="gonganLink || 'https://beian.mps.gov.cn/'"
class="icp-link"
rel="noopener noreferrer"
target="_blank"
>
{{ gonganNumber }}
</a>
</span>
<span v-if="siteTitle" class="footer-item">© {{ currentYear }} {{ siteTitle }}</span>
<span v-else class="footer-item">© {{ currentYear }} {{ copyrightOwner }}</span>
<span class="footer-item">响应耗时 {{ responseTime }}ms</span>
<span class="footer-item">
<a
class="voicehub-link"
href="https://github.com/laoshuikaixue/VoiceHub"
target="_blank"
rel="noopener noreferrer"
>
{{ displayName }} v{{ systemVersion }}
</a>
</span>
<span v-if="isNetlify" class="footer-item">
<a
href="https://www.netlify.com"
target="_blank"
rel="noopener noreferrer"
class="netlify-badge"
>
<img
src="https://www.netlify.com/img/global/badges/netlify-color-accent.svg"
alt="Deploys by Netlify"
>
</a>
</span>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue'
import { getCopyrightOwner, getSystemName } from '@/utils/core/security'
import packageJson from '~~/package.json'
// 使用 useSiteConfig composable 获取配置
const { siteTitle, siteVersion, icp: icpNumber, gonganNumber } = useSiteConfig()
const config = useRuntimeConfig()
// 自动生成公安联网备案链接
const gonganLink = computed(() => {
if (!gonganNumber.value) return '#'
// 提取数字部分
const codeMatch = gonganNumber.value.match(/\d+/)
const code = codeMatch ? codeMatch[0] : ''
if (!code) return '#'
return `https://beian.mps.gov.cn/#/query/webSearch?code=${code}`
})
const isNetlify = config.public.isNetlify
const copyrightOwner = getCopyrightOwner()
const systemName = getSystemName()
const systemVersion = computed(() => siteVersion.value || packageJson.version)
const displayName = computed(() => siteTitle.value || systemName)
const currentYear = new Date().getFullYear()
const responseTime = ref(0)
onMounted(() => {
if (typeof window !== 'undefined' && window.performance) {
// 使用 requestAnimationFrame 确保在渲染后计算
requestAnimationFrame(() => {
const loadTime = Math.round(window.performance.now())
responseTime.value = loadTime
})
}
})
</script>
<style scoped>
.site-footer {
text-align: center;
padding: 20px 0;
margin-top: 30px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
width: 100%;
}
.footer-info {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
gap: 0;
}
.footer-item {
color: rgba(255, 255, 255, 0.6);
font-size: 12px;
white-space: nowrap;
}
.footer-item:not(:last-child)::after {
content: ' | ';
margin: 0 10px;
color: rgba(255, 255, 255, 0.4);
}
.footer-item a {
color: inherit;
text-decoration: none;
transition: color 0.2s ease;
}
.footer-item a:hover {
color: rgba(255, 255, 255, 0.8);
}
.icp-link,
.voicehub-link {
color: inherit;
text-decoration: none;
transition: color 0.2s ease;
}
.icp-link:hover,
.voicehub-link:hover {
color: rgba(255, 255, 255, 0.8);
}
.netlify-badge {
display: inline-flex;
align-items: center;
vertical-align: middle;
}
.netlify-badge img {
height: 16px;
opacity: 0.8;
transition: opacity 0.2s ease;
}
.netlify-badge:hover img {
opacity: 1;
}
@media (max-width: 768px) {
.site-footer {
padding: 15px 0;
margin-top: 20px;
}
.footer-info {
gap: 0;
}
.footer-item {
font-size: 11px;
}
.footer-item:not(:last-child)::after {
margin: 0 2px;
}
}
</style>