1
0
mirror of synced 2026-03-23 19:28:40 +08:00

fix(data-source): 执行时机函数需要await

This commit is contained in:
roymondchen
2024-12-03 14:59:44 +08:00
committed by roymondchen
parent 12230c2f4e
commit 5caae4e953

View File

@@ -112,18 +112,18 @@ class DataSourceManager extends EventEmitter {
for (const method of ds.methods) {
if (typeof method.content !== 'function') return;
if (method.timing === 'beforeInit') {
method.content({ params: {}, dataSource: ds, app: this.app });
await method.content({ params: {}, dataSource: ds, app: this.app });
}
}
await ds.init();
ds.methods.forEach((method) => {
for (const method of ds.methods) {
if (typeof method.content !== 'function') return;
if (method.timing === 'afterInit') {
method.content({ params: {}, dataSource: ds, app: this.app });
await method.content({ params: {}, dataSource: ds, app: this.app });
}
});
}
}
public get(id: string) {