From 171e2365f3d89fdf74625dd09091ac8b9f226432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E6=B5=B7=E6=B4=8B?= Date: Thu, 4 Jun 2026 09:37:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E5=88=B6=2010000?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/goods.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/goods.js b/controllers/goods.js index faf6560..4c61f99 100644 --- a/controllers/goods.js +++ b/controllers/goods.js @@ -60,8 +60,9 @@ async function getGoods(ctx) { } if (ctx.query.limit && !ctx.query.page) { + const limit = Math.min(10000, Math.max(1, parseInt(ctx.query.limit) || 20)) sql += ' LIMIT ?' - params.push(parseInt(ctx.query.limit)) + params.push(limit) const goods = await query(sql, params) ctx.body = { code: 200, data: processGoodsImages(goods) } return