core: fix UserContext json

This commit is contained in:
undefined committed 2022-08-28 00:20:48 +08:00
1 parent 6e4e2d5ecf
commit 00bc92a2e1
4 files changed
+7 -4

No files matched your search

+1
View File
@@ -67,6 +67,7 @@ export async function saveConfig(config: any) {
}
export async function setConfig(key: string, value: any) {
const path = key.split('.');
if (path.filter((i) => ['__proto__', 'prototype'].includes(i)).length) throw new Error('Invalid key');
const t = path.pop();
let cursor = systemConfig;
for (const p of path) {