P0-3 二次修复: web 端函数名 getList → getMenuList
testspace 验证发现 loadMenu.getList is not a function web 端 menu.ts 实际函数名是 getMenuList (不是 getList) 镜像 web/api/system/menu.ts:8
This commit is contained in:
1 parent
83b3585c1f
commit
f4cb526cbc
1 file changed
+2
-2
@@ -43,9 +43,9 @@ interface SetDefaultOpts {
|
||||
async function resolveMenuIdFromPortal(portalId: string, _client: JnpfClient): Promise<string | null> {
|
||||
try {
|
||||
// 走 webapi menu list 找 moduleId=portalId 的菜单
|
||||
// 注: web ModuleBySystem 不支持 moduleId 过滤, 但 list 接口支持 (走 kw + 后端 sql filter)
|
||||
// 注: web 端函数是 getMenuList (不是 getList), 镜像 web/api/system/menu.ts:8
|
||||
// 兜底: 先 list 全部再客户端 filter
|
||||
const r = (await loadMenu.getList()) as { data?: unknown } | unknown
|
||||
const r = (await loadMenu.getMenuList()) as { data?: unknown } | unknown
|
||||
const list = (r as { data?: { list?: unknown[] } })?.data?.list
|
||||
|| (Array.isArray(r) ? r as unknown[] : [])
|
||||
const matched = (list as Array<{ id?: string; moduleId?: string }>).find(
|
||||
|
||||
Reference in new issue
Block a user