mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
perf: 修复内置插件分页查询逻辑
- 在前端添加 lastType 变量,用于判断类型变化并重置分页偏移量 - 在后端修改内置插件查询逻辑,支持分页请求 - 优化后端返回数据结构,使其与前端请求一致
This commit is contained in:
@@ -33,13 +33,21 @@ export class PluginService extends BaseService<PluginEntity> {
|
||||
if (pageReq.query.type && pageReq.query.type !== "builtIn") {
|
||||
return await super.page(pageReq);
|
||||
}
|
||||
//仅查询内置插件
|
||||
const offset = pageReq.page.offset;
|
||||
const limit = pageReq.page.limit;
|
||||
|
||||
|
||||
const builtInList = await this.getBuiltInEntityList();
|
||||
|
||||
//获取分页数据
|
||||
const data = builtInList.slice(offset, offset + limit);
|
||||
|
||||
return {
|
||||
records: builtInList,
|
||||
records: data,
|
||||
total: builtInList.length,
|
||||
offset: 0,
|
||||
limit: 99999
|
||||
offset: offset,
|
||||
limit: limit
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user