agent.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import request from '@/utils/request';
  2. // 获取论坛代理商列表
  3. type getAgentType = {
  4. curPage: number;
  5. state?: number;
  6. roleId?: string;
  7. label?: string | number;
  8. pageSize: number;
  9. };
  10. export async function getAgent(params: getAgentType): Promise<any> {
  11. return request('/forum/admin/agent', {
  12. params,
  13. });
  14. }
  15. // 获取代理商详情
  16. export async function getAgentDetail(id: string): Promise<any> {
  17. return request(`/forum/admin/agent/${id}`);
  18. }
  19. // 代理商 停用或者启用
  20. type stopOrOpenAgentType = {
  21. state: number;
  22. };
  23. export async function stopOrOpenAgent(id: string, params: stopOrOpenAgentType): Promise<any> {
  24. return request(`/forum/admin/agent/${id}`, { method: 'PATCH', params });
  25. }
  26. // 更改代理商信息
  27. export async function editAgentInfo(data: any) {
  28. return request(`/forum/admin/agent`, { method: 'PUT', data });
  29. }
  30. /**
  31. * @description 开通或关闭管理员
  32. * @author 朱波
  33. * @date 2022/10/27
  34. */
  35. export async function changeAdminManagement(userId: string, state: number | string) {
  36. return request(`/forum/admin/agent/management/${userId}/${state}`, { method: 'PUT' });
  37. }