
import request from '@/utils/request'

/**
 * 管理员列表
 * @param {请求参数} params
 */
export function fetchAdminList(params) {
  return request({
    url: '/admin/User/adminList',
    method: 'get',
    params: params
  })
}

/**
 * 保存管理员
 * @param {{phone: ([{trigger: string, message: string, required: boolean}, {min: number, max: number, trigger: string, message: string}]|string|{label: string, value: boolean}|[{trigger: string, message: string, required: boolean}]|string), roleId: ([{trigger: string, message: string, required: boolean}]|string), memo, id: *, state: *, pwd: ([{trigger: string, message: string, required: boolean}, {min: number, max: number, trigger: string, message: string}]|default.methods.selectItem.pwd|string)}} params
 */
export function saveAdmin(params) {
  return request({
    url: '/admin/User/saveAdmin',
    method: 'post',
    data: params
  })
}

/**
 * 删除管理员
 */
export function delAdmin(params) {
  return request({
    url: '/admin/User/delAdmin',
    method: 'post',
    data: params
  })
}

