import request from '@/utils/request.js'

export const getUser = (params) => {
  return request({
    url: '/admin/user/tunnel',
    method: 'get',
    params
  })
}
export const getUserDetail = (userId) => {
  return request({
    url: `/admin/user/info/${userId}`,
    method: 'get'
  })
}
export const editUser = (data) => {
  return request({
    url: '/admin/user',
    method: 'put',
    data
  })
}
export const addUser = (data) => {
  return request({
    url: '/admin/user',
    method: 'post',
    data
  })
}
export const deleteUser = (userId) => {
  return request({
    url: `/admin/user/${userId}`,
    method: 'delete'
  })
}

export const getRoleOption = () => {
  return request({
    url: '/admin/role/option',
    method: 'get'
  })
}
