diff --git a/components/GongAnBeiAn.js b/components/GongAnBeiAn.js index 61c8d6e1..ed5a19c2 100644 --- a/components/GongAnBeiAn.js +++ b/components/GongAnBeiAn.js @@ -6,12 +6,9 @@ import LazyImage from './LazyImage' * @returns */ export const GongAnBeiAn = () => { - const BEI_AN_GONGAN = siteConfig( - 'BEI_AN_GONGAN', - '京公网安备 11010102000001号' - ) + const BEI_AN_GONGAN = siteConfig('BEI_AN_GONGAN') // 从BEI_AN_GONGAN 字段中利用正则匹配提取出纯数字部分 - const codeMatch = BEI_AN_GONGAN.match(/\d+/) // 匹配纯数字 + const codeMatch = BEI_AN_GONGAN?.match(/\d+/) // 匹配纯数字 const code = codeMatch ? codeMatch[0] : null // 如果匹配成功则取出数字部分 const href = `https://beian.mps.gov.cn/#/query/webSearch?code=${code}` // 动态生成链接