mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 06:46:09 +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) {}
|
||||
|
||||
public async findTokenByValue(token: string): Promise<App | null> {
|
||||
const doc = await this.getDb(
|
||||
sequelize.fn(
|
||||
'JSON_CONTAINS',
|
||||
sequelize.col('tokens'),
|
||||
JSON.stringify({ value: token }),
|
||||
),
|
||||
);
|
||||
return doc;
|
||||
AppModel.upsert;
|
||||
const docs = await this.find({});
|
||||
const doc = docs.filter((x) => x.tokens?.find((y) => y.value === token));
|
||||
return doc[0];
|
||||
}
|
||||
|
||||
public async create(payload: App): Promise<App> {
|
||||
|
|
Loading…
Reference in New Issue
Block a user