core: 修复设置中无法取消选中checkbox的问题

This commit is contained in:
undefined committed 2021-03-07 18:46:09 +08:00
1 parent 7a41fecb0e
commit a81d514b10
11 files changed
+29 -21

No files matched your search

+1 -1
View File
@@ -159,7 +159,7 @@ class JudgeConnectionHandler extends ConnectionHandler {
async cleanup() {
if (this.processing) {
await record.reset(this.processing.domainId, this.processing.rid, false);
task.add(this.processing);
await task.add(this.processing);
}
}
}
+9
View File
@@ -144,6 +144,8 @@ class SystemSettingHandler extends SystemHandler {
async post(args: any) {
const tasks = [];
const booleanKeys = args.booleanKeys || {};
delete args.booleanKeys;
for (const key in args) {
if (typeof args[key] === 'object') {
for (const subkey in args[key]) {
@@ -154,6 +156,13 @@ class SystemSettingHandler extends SystemHandler {
}
}
}
for (const key in booleanKeys) {
if (typeof booleanKeys[key] === 'object') {
for (const subkey in booleanKeys[key]) {
if (!args[key][subkey]) tasks.push(system.set(`${key}.${subkey}`, false));
}
}
}
tasks.push(bus.parallel('system/setting', args));
await Promise.all(tasks);
this.back();