mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: 优化钩子逻辑
This commit is contained in:
1 parent
03dc8903e2
commit
f2f0212947
27 files changed
+205
-124
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import { Collection } from 'mongodb';
|
||||
import { TokenDoc } from '../interface';
|
||||
import * as db from '../service/db';
|
||||
import * as bus from '../service/bus';
|
||||
|
||||
export const coll: Collection<TokenDoc> = db.collection('token');
|
||||
|
||||
@@ -87,7 +88,7 @@ export function delByUid(uid: number) {
|
||||
return coll.deleteMany({ uid });
|
||||
}
|
||||
|
||||
global.Hydro.postInit.push(ensureIndexes);
|
||||
bus.once('app/started', ensureIndexes);
|
||||
global.Hydro.model.token = {
|
||||
coll,
|
||||
|
||||
|
||||
Reference in new issue
Block a user