From 729f91a4dc08804dddf4e63098597a27d6b88155 Mon Sep 17 00:00:00 2001 From: ssw Date: Thu, 25 Jun 2026 15:56:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(v0.11+):=20user/list.ts=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E6=AE=8B=E7=95=99=E6=AD=BB=E4=BB=A3=E7=A0=81=20(commi?= =?UTF-8?q?t=207224156=20botched=20merge)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 回归 bug: 上一轮 commit 7224156 重构时, 行 47-48 残留旧版本 `process.exit(1)` + `}` 死代码, 导致 46/49 行重复声明 `const list`, 全 dacli 命令启动崩溃 (Expected ')' but found 'const'). 修复: 合并为 `const list = r.list || r.data?.list || []` (兼容两种 webapi 响应结构). 验证: `dacli form --help` 和 `dacli user list --keyword=admin` 都正常输出. --- src/commands/user/list.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/commands/user/list.ts b/src/commands/user/list.ts index 8903a46..214d1bd 100644 --- a/src/commands/user/list.ts +++ b/src/commands/user/list.ts @@ -43,10 +43,7 @@ export function buildUserListCommand(): Command { log.error(`user list 失败: ${(r as { msg?: string }).msg}`) process.exit(1) } - const list = r.list || [] - process.exit(1) - } - const list = r.data?.list || [] + const list = r.list || r.data?.list || [] if (opts.json) { printJson(r) return