This commit is contained in:
tangly1024
2024-11-19 21:25:01 +08:00
parent a5ee8f059c
commit 9690d06fbd

View File

@@ -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) {