auto(14b5ea1b9bd9): session end @ 2026-07-25T16:43:08 (+1f)
This commit is contained in:
1 parent
6fc262f8c0
commit
84d7882118
1 file changed
+5
-2
@@ -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<data:T|null>),
|
||||
// 避免 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 || ''),
|
||||
|
||||
Reference in new issue
Block a user