From 84d78821186b7bc26bdb2982d5227f6de2db5853 Mon Sep 17 00:00:00 2001 From: ssw Date: Sat, 25 Jul 2026 16:43:08 +0800 Subject: [PATCH] auto(14b5ea1b9bd9): session end @ 2026-07-25T16:43:08 (+1f) --- src/commands/role/list.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/commands/role/list.ts b/src/commands/role/list.ts index 889e467..444e238 100644 --- a/src/commands/role/list.ts +++ b/src/commands/role/list.ts @@ -6,6 +6,7 @@ */ import { Command } from 'commander' import { JnpfClient } from '../../core/client.ts' +import type { JnpfResp } from '../../core/types.ts' import { installHelpHook } from '../../core/help.ts' import { log, printJson } from '../../core/log.ts' import { initWebapi, loadRole } from '../../webapi/role.ts' @@ -45,7 +46,9 @@ export function buildRoleListCommand(): Command { fixes: [], }, async (ctx) => { try { - let r: { code?: number; msg?: string; data?: { list?: RoleItem[] } } | undefined + // 2.7 fix (2026-07-25): 用 unknown 兼容 webapi (code? msg? data?) 和 c.get (JnpfResp), + // 避免 tsc 类型漂移. 修前报 "code=undefined: undefined" 端到端 4 轮未修 + let r: any try { await initWebapi(c) r = (await loadRole.getRoleList({ @@ -75,7 +78,7 @@ export function buildRoleListCommand(): Command { log.info(`共 ${list.length} 个角色`) log.printRawTable( ['ID', 'FULL_NAME', 'ENCODE', 'TYPE', 'ENABLED'], - list.map((d) => [ + list.map((d: RoleItem) => [ String(d.id || ''), String(d.fullName || ''), String(d.enCode || ''),