fix(server): 路由 id 使用 ParseIntPipe,限制分页与批量数组上限

This commit is contained in:
2026-08-07 16:38:03 +08:00
parent 899d2dde5b
commit 5b5ffb5b9e
14 changed files with 96 additions and 58 deletions

View File

@@ -131,8 +131,8 @@ export class AttendanceQueryService {
},
accessibleClassIds?: number[],
) {
const page = query.page || 1;
const pageSize = query.pageSize || 20;
const page = Math.max(1, Math.floor(Number(query.page) || 1));
const pageSize = Math.min(200, Math.max(1, Math.floor(Number(query.pageSize) || 20)));
const qb = this.attendanceRepo.createQueryBuilder('ar');
@@ -233,8 +233,8 @@ export class AttendanceQueryService {
// ── DingAttendance raw records ──
async getDingRaw(query: QueryDingRawDto, accessibleClassIds?: number[]) {
const page = query.page || 1;
const pageSize = query.pageSize || 20;
const page = Math.max(1, Math.floor(Number(query.page) || 1));
const pageSize = Math.min(200, Math.max(1, Math.floor(Number(query.pageSize) || 20)));
const qb = this.dingRawRepo.createQueryBuilder('ar');
qb.leftJoinAndSelect('ar.matchedStudent', 'matchedStudent');