import { defAxios as request } from '@/utils/http'
/**
 * 获取用户分页数据接口
 * @returns 用户分页
 */
export function getUserList(params) {
  return request({
    url: '/user/index',
    method: 'GET',
    params
  })
}

/**
 * 添加用户
 * params
 */
export function addUser(data) {
  return request({
    url: '/user/add',
    method: 'POST',
    data
  })
}

/**
 * 编辑部门
 * params
 */
export function editUser(data) {
  return request({
    url: '/user/edit',
    method: 'PUT',
    data
  })
}

/**
 * 删除用户
 * params
 */
export function deleteUser(idList) {
  return request({
    url: `/user/delete/${idList}`,
    method: 'DELETE'
  })
}

/**
 * 设置用户状态
 * params
 */
export function setUserStatus(data) {
  return request({
    url: '/user/status',
    method: 'PUT',
    data
  })
}

/**
 * 重置用户密码
 * params
 */
export function resetPassword(data) {
  return request({
    url: '/user/resetPwd',
    method: 'PUT',
    data
  })
}
