core: loader: add missing inject

This commit is contained in:
undefined committed 2025-03-09 15:26:28 +08:00
1 parent 4c086db05c
commit a459b9a1fd
5 files changed
+15 -14

No files matched your search

+4 -4
View File
@@ -183,12 +183,12 @@ class SystemConfigHandler extends SystemHandler {
@requireSudo
async get() {
this.response.template = 'manage_config.html';
let value = this.ctx.get('config').configSource;
let value = this.ctx.config.configSource;
try {
value = yaml.dump(Schema.intersect(this.ctx.get('config').settings)(yaml.load(value)));
value = yaml.dump(Schema.intersect(this.ctx.config.settings)(yaml.load(value)));
} catch (e) { }
this.response.body = {
schema: Schema.intersect(this.ctx.get('config').settings).toJSON(),
schema: Schema.intersect(this.ctx.config.settings).toJSON(),
value,
};
}
@@ -202,7 +202,7 @@ class SystemConfigHandler extends SystemHandler {
} catch (e) {
throw new ValidationError('value');
}
await this.ctx.get('config').saveConfig(config);
await this.ctx.config.saveConfig(config);
}
}