修复当只传入id参数时的判断逻辑错误

This commit is contained in:
2025-12-12 11:56:09 +08:00
parent 22fac88d01
commit 63e853641b

View File

@@ -108,7 +108,7 @@ app.route({
}).define(async (ctx) => { }).define(async (ctx) => {
const id = ctx.query.id; const id = ctx.query.id;
const ids = ctx.query.ids || []; const ids = ctx.query.ids || [];
if (!id || ids.length === 0) { if (!id && ids.length === 0) {
ctx.throw(400, '缺少参数 id'); ctx.throw(400, '缺少参数 id');
} }
if (ids.length === 0 && id) { if (ids.length === 0 && id) {