import request from '@/utils/request'

export function login(data: any) {
  return request.post('/login', data)
}

export function getUserInfo() {
  return request.get('/system/user/userInfo')
}

// 用户列表
export function getUserList(data?: any) {
  return request.post('/sys/user/list', data)
}
// 新增用户
export function createUser(data: any) {
  return request.post('/sys/user/save', data)
}
// 修改用户
export function updateUser(data: any) {
  return request.post('/sys/user/update', data)
}
//删除用户
export function delUser(data: any) {
  return request.get('/sys/user/deleteAll', {
    params: data
  })
}
// 登录名查重
export function checkLoginName(data: any) {
  return request.get('/sys/user/checkLoginName', {
    params: data
  })
}

// 获取用户菜单列表
export function getMenuList(data?: any) {
  return request.get('/sys/menu/treeData', data)
}
