mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
修复openapi认证,环境变量排序
This commit is contained in:
@@ -108,15 +108,18 @@ export default class EnvService {
|
||||
};
|
||||
}
|
||||
try {
|
||||
const result = await this.find(condition);
|
||||
const result = await this.find(condition, [['position', 'DESC']]);
|
||||
return result as any;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
private async find(query: any, sort?: any): Promise<Env[]> {
|
||||
const docs = await EnvModel.findAll({ where: { ...query } });
|
||||
private async find(query: any, sort: any = []): Promise<Env[]> {
|
||||
const docs = await EnvModel.findAll({
|
||||
where: { ...query },
|
||||
order: [...sort],
|
||||
});
|
||||
return docs;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user