diff --git a/lib/config.js b/lib/config.js index 7457ac3a..be7815b7 100644 --- a/lib/config.js +++ b/lib/config.js @@ -4,9 +4,6 @@ import BLOG from '@/blog.config' import { useGlobal } from './global' import { deepClone, isUrl } from './utils' -const getValue = (value, fallback) => (hasVal(value) ? fallback : value) -const hasVal = value => value !== undefined && value !== null - /** * 读取配置顺序 * 1. 优先读取NotionConfig表 @@ -21,6 +18,8 @@ export const siteConfig = (key, defaultVal = null, extendConfig = {}) => { if (!key) { return null } + const getValue = (value, fallback) => (hasVal(value) ? value : fallback) + const hasVal = value => value !== undefined && value !== null // 特殊配置处理;以下配置只在服务端生效;而Global的NOTION_CONFIG仅限前端组件使用,因此需要从extendConfig中读取 switch (key) {