import { defAxios as request } from '@/utils/http'

/**
 * 获取用户列表(分页)
 * @param {Object}
 * @returns
 */
export function userPage(params) {
  return request({
    url: '/user/index',
    method: 'get',
    params
  })
}

/**
 * 创建用户
 * @returns
 */
export function userCreate(data) {
  return request({
    url: '/user/add',
    method: 'post',
    data
  })
}
/**
 * 编辑用户
 * @returns
 */
export function userUpdate(data) {
  return request({
    url: '/user/edit',
    method: 'put',
    data
  })
}
/**
 * 删除用户
 * @returns
 */
export function userDelete(ids) {
  return request({
    url: `/delete/${ids}`,
    method: 'delete'
  })
}
