refactor: 备案号改为环境变量配置
ICP 和公安备案号通过 NUXT_PUBLIC_ICP / NUXT_PUBLIC_PS_BEIAN 环境变量读取, 空值时底部不显示。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+3
-3
@@ -1,3 +1,3 @@
|
|||||||
# 站点配置(可选,config/site.ts 中已有默认值)
|
# 备案号(必填,否则底部不显示)
|
||||||
NUXT_PUBLIC_SITE_URL=https://2x.nz
|
NUXT_PUBLIC_ICP=蜀ICP备XXXXXXXXXX号
|
||||||
NUXT_PUBLIC_SITE_NAME=《二叉树树》官方网站
|
NUXT_PUBLIC_PS_BEIAN=51015602001952
|
||||||
|
|||||||
@@ -1,19 +1,25 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { siteConfig } from '~/config/site'
|
import { siteConfig } from '~/config/site'
|
||||||
|
|
||||||
|
const config = useRuntimeConfig()
|
||||||
|
const icp = config.public.icp
|
||||||
|
const psBeian = config.public.psBeian
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<footer class="py-6 text-center text-sm border-t" style="color: var(--color-text-secondary); border-color: var(--color-border);">
|
<footer class="py-6 text-center text-sm border-t" style="color: var(--color-text-secondary); border-color: var(--color-border);">
|
||||||
<p>
|
<p>
|
||||||
© {{ new Date().getFullYear() }} {{ siteConfig.siteName }}
|
© {{ new Date().getFullYear() }} {{ siteConfig.siteName }}
|
||||||
<template v-if="siteConfig.icp">
|
<template v-if="icp">
|
||||||
·
|
·
|
||||||
<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;">{{ siteConfig.icp }}</a>
|
<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">
|
||||||
|
·
|
||||||
|
<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>
|
</template>
|
||||||
·
|
|
||||||
<a href="https://beian.mps.gov.cn/#/query/webSearch?code=51015602001952" 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" />川公网安备51015602001952号
|
|
||||||
</a>
|
|
||||||
</p>
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -6,6 +6,13 @@ export default defineNuxtConfig({
|
|||||||
compatibilityDate: '2025-01-01',
|
compatibilityDate: '2025-01-01',
|
||||||
devtools: { enabled: true },
|
devtools: { enabled: true },
|
||||||
|
|
||||||
|
runtimeConfig: {
|
||||||
|
public: {
|
||||||
|
icp: '',
|
||||||
|
psBeian: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
css: ['~/assets/css/main.css'],
|
css: ['~/assets/css/main.css'],
|
||||||
|
|
||||||
modules: [
|
modules: [
|
||||||
|
|||||||
Reference in New Issue
Block a user