import request from "@/utils/request"
const api = "/mosty-api"
const api2 = "/mosty-wljc"
export const getApi2 = (params = {}, url = "") => {
  return request({
    url: api + url,
    method: "GET",
    params
  })
}
export const getApi = (params = {}, url = "") => {
  return request({
    url: api + url,
    method: "GET",
    params
  })
}
export const getApiToken = (params = {}, url = "") => {
  return request({
    url: url,
    method: "GET",
    params
  })
}

export const postApi2 = (data = {}, url = "") => {
  return request({
    url: api + url,
    method: "POST",
    data
  })
}
export const postApi = (data = {}, url = "") => {
  return request({
    url: api + url,
    method: "POST",
    data
  })
}

export const putApi = (data = {}, url = "") => {
  return request({
    url: api + url,
    method: "PUT",
    params: data
  })
}

export const deleteApi2 = (data = {}, url = "") => {
  return request({
    url: api + url,
    method: "DELETE",
    data
  })
}
export const deleteApi = (data = {}, url = "") => {
  return request({
    url: api + url,
    method: "DELETE",
    data
  })
}
export const uploadfilApi = (data = {}, url = "") => {
  return request({
    url: api + url,
    method: "POST",
    headers: {
      "Content-Type": "multipart/form-data"
    },
    data
  })
}
//导出为excel
export const uploadExcel = (data = {}, url = "") => {
  return request({
    url: api + url,
    method: "Get",
    responseType: "blob",
    data
  })
}
