Files
SuBlog/components/layout/Footer.vue
T
sutong d7b7fc0398 refactor: 备案号改为环境变量配置
ICP 和公安备案号通过 NUXT_PUBLIC_ICP / NUXT_PUBLIC_PS_BEIAN 环境变量读取,
空值时底部不显示。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 23:22:04 +08:00

26 lines
1.1 KiB
Vue

<script setup lang="ts">
import { siteConfig } from '~/config/site'
const config = useRuntimeConfig()
const icp = config.public.icp
const psBeian = config.public.psBeian
</script>
<template>
<footer class="py-6 text-center text-sm border-t" style="color: var(--color-text-secondary); border-color: var(--color-border);">
<p>
&copy; {{ new Date().getFullYear() }} {{ siteConfig.siteName }}
<template v-if="icp">
&nbsp;·&nbsp;
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer" class="hover:opacity-70" style="border-bottom: 1px solid var(--color-text-secondary); padding-bottom: 1px;">{{ icp }}</a>
</template>
<template v-if="psBeian">
&nbsp;·&nbsp;
<a :href="`https://beian.mps.gov.cn/#/query/webSearch?code=${psBeian}`" rel="noreferrer" target="_blank" class="hover:opacity-70" style="border-bottom: 1px solid var(--color-text-secondary); padding-bottom: 1px;">
<img src="@/assets/备案图标.png" alt="" class="w-3 h-3 inline" />川公网安备{{ psBeian }}
</a>
</template>
</p>
</footer>
</template>