fix(settings): bug

- 移除空值转换
This commit is contained in:
Aqr-K
2024-11-14 23:43:25 +08:00
committed by GitHub
parent e6357d0a54
commit 384e1a63b3

View File

@@ -79,15 +79,7 @@ async function loadSiteSettings() {
// 将API返回的值赋值给SystemSettings
for (const sectionKey of Object.keys(siteSetting.value) as Array<keyof typeof siteSetting.value>) {
Object.keys(siteSetting.value[sectionKey]).forEach((key: string) => {
let v: any
if (result.data.hasOwnProperty(key)) {
v = result.data[key]
// 空字符串转为null避免空字符串导致前端显示问题
if (v === '') {
v = null
}
;(siteSetting.value[sectionKey] as any)[key] = v
}
if (result.data.hasOwnProperty(key)) (SystemSettings.value[sectionKey] as any)[key] = result.data[key]
})
}
}