mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
bump version
This commit is contained in:
43 files changed
+96
-53
No files matched your search
@@ -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;
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
Reference in new issue
Block a user