mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-07-28 01:07:52 +08:00
call sqlite-plugin in run-core
This commit is contained in:
@@ -33,7 +33,18 @@ async function initDb() {
|
||||
return appDataSource.initialize();
|
||||
}
|
||||
|
||||
(async () => {
|
||||
const a = await initDb();
|
||||
console.log(a);
|
||||
})();
|
||||
export default class SqlitePlugin {
|
||||
initPromise: Promise<DataSource>
|
||||
|
||||
constructor () {
|
||||
this.initPromise = initDb()
|
||||
}
|
||||
apply (hooks) {
|
||||
hooks.userInfoResponse.tapPromise(
|
||||
'SqlitePlugin',
|
||||
(userInfo) => new Promise((resolve, reject) => {
|
||||
console.log(userInfo)
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user