fix: show fallback ICP number in footer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -2,13 +2,16 @@ import { getSiteSettings } from "@/services/site-settings.service";
|
||||
import { getNavigationMenu } from "@/services/navigation.service";
|
||||
import Image from "next/image";
|
||||
|
||||
// 合规要求:中国大陆网站需展示 ICP 备案号并链接至工信部备案查询。
|
||||
// 详见 documents/设计方案分析与完善版.md §2.15。
|
||||
const FALLBACK_ICP_NUMBER = "冀ICP备2025130506号-1";
|
||||
const FALLBACK_ICP_URL = "https://beian.miit.gov.cn/";
|
||||
|
||||
export default async function Footer() {
|
||||
// 优先使用后台配置的站点设置(apps.core.SiteSettings),
|
||||
// 未配置备案号时不展示其他企业的备案信息。
|
||||
// 接口不可用时回退到硬编码的备案信息,保证构建/渲染始终可用。
|
||||
const [siteSettings, menu] = await Promise.all([getSiteSettings(), getNavigationMenu("footer")]);
|
||||
const icpNumber = siteSettings?.icp_number;
|
||||
const icpNumber = siteSettings?.icp_number || FALLBACK_ICP_NUMBER;
|
||||
const icpUrl = siteSettings?.icp_url || FALLBACK_ICP_URL;
|
||||
const qrcode = siteSettings?.wechat_qrcode;
|
||||
const qrcodeUrl = qrcode?.url ? new URL(qrcode.url, process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000").href : null;
|
||||
@@ -36,7 +39,7 @@ export default async function Footer() {
|
||||
© {new Date().getFullYear()}{" "}
|
||||
{siteSettings?.company_name || "企业官网"}. All rights reserved.
|
||||
</p>
|
||||
{icpNumber && <p className="mt-2">
|
||||
<p className="mt-2">
|
||||
<a
|
||||
href={icpUrl}
|
||||
target="_blank"
|
||||
@@ -45,7 +48,7 @@ export default async function Footer() {
|
||||
>
|
||||
{icpNumber}
|
||||
</a>
|
||||
</p>}
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user