mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-24 15:43:24 +08:00
修复openapi token 查询
This commit is contained in:
parent
43bc29b25c
commit
6f96900ab9
|
@ -12,15 +12,9 @@ export default class OpenService {
|
||||||
constructor(@Inject('logger') private logger: winston.Logger) {}
|
constructor(@Inject('logger') private logger: winston.Logger) {}
|
||||||
|
|
||||||
public async findTokenByValue(token: string): Promise<App | null> {
|
public async findTokenByValue(token: string): Promise<App | null> {
|
||||||
const doc = await this.getDb(
|
const docs = await this.find({});
|
||||||
sequelize.fn(
|
const doc = docs.filter((x) => x.tokens?.find((y) => y.value === token));
|
||||||
'JSON_CONTAINS',
|
return doc[0];
|
||||||
sequelize.col('tokens'),
|
|
||||||
JSON.stringify({ value: token }),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
return doc;
|
|
||||||
AppModel.upsert;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async create(payload: App): Promise<App> {
|
public async create(payload: App): Promise<App> {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user