diff --git a/server/src/routes/logs.ts b/server/src/routes/logs.ts index e41da99..8fcd393 100644 --- a/server/src/routes/logs.ts +++ b/server/src/routes/logs.ts @@ -157,14 +157,15 @@ router.get('/track/list', requireAdmin, async (req, res) => { ) const total = (countResult as any[])[0].total + // LIMIT/OFFSET 直接嵌入 SQL(mysql2 execute 对这些参数类型要求严格) const [rows] = await pool.execute( `SELECT t.*, u.nickname FROM track_events t LEFT JOIN users u ON t.user_id = u.id WHERE ${where} ORDER BY t.created_at DESC - LIMIT ? OFFSET ?`, - [...params, pSize, offset] + LIMIT ${pSize} OFFSET ${offset}`, + params ) res.json({