mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix UserContext json
This commit is contained in:
1 parent
6e4e2d5ecf
commit
00bc92a2e1
4 files changed
+7
-4
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user