import micro_request from '@/utils/micro_request'

const basePath = process.env.VUE_APP_AdminPath
export default {
  // 获取列表
  getList(query) {
    return micro_request.postRequest(basePath, 'User', 'GetList', query)
  },
  doAdd(query) {
    return micro_request.postRequest(basePath, 'User', 'Add', query)
  },
  doEdit(query) {
    return micro_request.postRequest(basePath, 'User', 'UpdateById', query)
  },
  doDelete(query) {
    return micro_request.postRequest(basePath, 'User', 'DeleteUserByIds', query)
  },
}

import request from '@/utils/request'

export async function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data,
  })
}

export function getUserInfo() {
  return request({
    url: '/userInfo',
    method: 'get',
  })
}

export function logout() {
  return request({
    url: '/logout',
    method: 'get',
  })
}

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

export function doEdit(data) {
  return request({
    url: '/userManagement/doEdit',
    method: 'post',
    data,
  })
}

export function doDelete(data) {
  return request({
    url: '/userManagement/doDelete',
    method: 'post',
    data,
  })
}
