36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import { createSessionClient } from "../../core/http/session-client.js";
|
|
import type { CorpConfig } from "../../core/config/types.js";
|
|
import {
|
|
fetchDesktopMenuTree,
|
|
fetchWorkbenchApps,
|
|
fetchAppCenterMenus,
|
|
} from "./api.js";
|
|
import type { MenuItem, WorkbenchApp } from "./types.js";
|
|
|
|
/** 获取桌面端工作台【应用管理】下的业务应用列表 */
|
|
export async function fetchWorkbenchAppsList(
|
|
corp: CorpConfig
|
|
): Promise<WorkbenchApp[]> {
|
|
const client = await createSessionClient(corp);
|
|
const corpId = corp.corpId || corp.credentials.corpId;
|
|
return fetchWorkbenchApps(client, corpId);
|
|
}
|
|
|
|
/** 获取桌面端全站主框架导航菜单树 */
|
|
export async function fetchDesktopMenus(
|
|
corp: CorpConfig
|
|
): Promise<MenuItem[]> {
|
|
const client = await createSessionClient(corp);
|
|
const corpId = corp.corpId || corp.credentials.corpId;
|
|
return fetchDesktopMenuTree(client, corpId);
|
|
}
|
|
|
|
/** 获取【应用中心】下的子栏目 */
|
|
export async function fetchAppCenterSubMenus(
|
|
corp: CorpConfig
|
|
): Promise<MenuItem[]> {
|
|
const client = await createSessionClient(corp);
|
|
const corpId = corp.corpId || corp.credentials.corpId;
|
|
return fetchAppCenterMenus(client, corpId);
|
|
}
|