2026-07-27 00:18:42 +08:00
|
|
|
import { request } from './http';
|
|
|
|
|
import { resourceApi } from './resource';
|
|
|
|
|
|
|
|
|
|
/** 平台角色、菜单、账号和工作台接口。 */
|
|
|
|
|
export type PlatformRole = { identity: string; role_code: string; name: string; data_scope: string; is_system: boolean; status: string };
|
|
|
|
|
export type PlatformMenu = { id: number; identity: string; parent_id: number; menu_code: string; name: string; icon: string; path: string; sort_no: number };
|
|
|
|
|
|
|
|
|
|
export const platformApi = {
|
|
|
|
|
overview: () => request<Record<string, number>>('/dashboard/overview'),
|
|
|
|
|
listAccount: () => request<{ total: number; list: Record<string, unknown>[] }>('/platform/platfrom_account'),
|
|
|
|
|
listRole: () => resourceApi.list<PlatformRole>('/platform/platform_role'),
|
|
|
|
|
createRole: (data: Record<string, unknown>) => resourceApi.create<PlatformRole>('/platform/platform_role', data),
|
|
|
|
|
listMenu: () => request<{ total: number; list: PlatformMenu[] }>('/platform/platform_menu'),
|
2026-07-26 18:06:14 +08:00
|
|
|
};
|