import type { Recordable } from '@vben/types'; import { requestClient } from '#/api/request'; export namespace SystemRoleApi { export interface SystemRole { [key: string]: any; id: string; name: string; permissions: string[]; remark?: string; status: 0 | 1; } } /** * 获取角色列表数据 */ async function getRoleList(params: Recordable) { return requestClient.get>( '/system/role/list', { params }, ); } /** * 创建角色 * @param data 角色数据 */ async function createRole(data: Omit) { return requestClient.post('/system/role', data); } /** * 更新角色 * * @param id 角色 ID * @param data 角色数据 */ async function updateRole( id: string, data: Omit, ) { return requestClient.put(`/system/role/${id}`, data); } /** * 删除角色 * @param id 角色 ID */ async function deleteRole(id: string) { return requestClient.delete(`/system/role/${id}`); } export { createRole, deleteRole, getRoleList, updateRole };