import { parseStrEmpty } from '/@/utils/index'
import request from '/@/utils/request'

export function getList(params?: any) {
  return request({
    url: '/userManagement/getList',
    method: 'get',
    params,
  })
}

export const doAdd = (data: any) => {
  return request({
    url: '/system/user',
    method: 'post',
    data,
  })
}

export const doEdit = (data: any) => {
  return request({
    url: '/system/user',
    method: 'put',
    data,
  })
}

export const doDelete = (data: any) => {
  return request({
    url: '/userManagement/doDelete',
    method: 'post',
    data,
  })
}

// 查询用户详细
export function getUser(userId: any) {
  return request({
    url: `/system/user/${parseStrEmpty(userId)}`,
    method: 'get',
  })
}
