bump version

This commit is contained in:
undefined committed 2025-04-03 02:32:22 +08:00
1 parent 8af621222c
commit 6aef4695f2
43 files changed
+96 -53

No files matched your search

+4 -4
View File
@@ -31,12 +31,12 @@ class BlackListModel {
}
}
export function apply(ctx: Context) {
coll = db.collection('blacklist');
ctx.on('ready', () => db.ensureIndexes(
export async function apply(ctx: Context) {
coll = ctx.db.collection('blacklist');
await ctx.db.ensureIndexes(
coll,
{ key: { expireAt: -1 }, name: 'expire', expireAfterSeconds: 0 },
));
);
}
export default BlackListModel;
global.Hydro.model.blacklist = BlackListModel;
+1
View File
@@ -34,6 +34,7 @@ export interface OAuthProvider {
hidden?: boolean;
get: (this: Handler) => Promise<void>;
callback: (this: Handler, args: Record<string, any>) => Promise<OAuthUserResponse>;
canRegister?: boolean;
lockUsername?: boolean;
}
+8 -6
View File
@@ -1,6 +1,6 @@
import { Filter } from 'mongodb';
import { Context } from '../context';
import { TokenDoc } from '../interface';
import bus from '../service/bus';
import db from '../service/db';
import { ArgMethod } from '../utils';
@@ -107,10 +107,12 @@ class TokenModel {
}
}
bus.on('ready', () => db.ensureIndexes(
TokenModel.coll,
{ key: { uid: 1, tokenType: 1, updateAt: -1 }, name: 'basic', sparse: true },
{ key: { expireAt: -1 }, name: 'expire', expireAfterSeconds: 0 },
));
export async function apply(ctx: Context) {
await ctx.db.ensureIndexes(
TokenModel.coll,
{ key: { uid: 1, tokenType: 1, updateAt: -1 }, name: 'basic', sparse: true },
{ key: { expireAt: -1 }, name: 'expire', expireAfterSeconds: 0 },
);
}
export default TokenModel;
global.Hydro.model.token = TokenModel;