import request from '@/utils/request'; // 获取论坛代理商列表 type getAgentType = { curPage: number; state?: number; roleId?: string; label?: string | number; pageSize: number; }; export async function getAgent(params: getAgentType): Promise { return request('/forum/admin/agent', { params, }); } // 获取代理商详情 export async function getAgentDetail(id: string): Promise { return request(`/forum/admin/agent/${id}`); } // 代理商 停用或者启用 type stopOrOpenAgentType = { state: number; }; export async function stopOrOpenAgent(id: string, params: stopOrOpenAgentType): Promise { return request(`/forum/admin/agent/${id}`, { method: 'PATCH', params }); } // 更改代理商信息 export async function editAgentInfo(data: any) { return request(`/forum/admin/agent`, { method: 'PUT', data }); } /** * @description 开通或关闭管理员 * @author 朱波 * @date 2022/10/27 */ export async function changeAdminManagement(userId: string, state: number | string) { return request(`/forum/admin/agent/management/${userId}/${state}`, { method: 'PUT' }); }