import service from "../utils/request";
import {Url} from "../utils/urlFormat";

export const getMethodCommon = function (_url, params) {
    let urls = new Url()
    let new_url = urls.getUrl(_url, params)
    return service({
        url: new_url,
        method: 'GET',
        headers:{
            'X-Token': localStorage.getItem("Token")   
        }
    })
}

export const getMethodCommon1 = function (_url, params) {
    let urls = new Url()
    let new_url = urls.getUrl(_url, params)
    return service({
        url: new_url,
        method: 'GET',
        headers:{
            'X-Token': localStorage.getItem("Token")   
        },
        responseType: 'blob',
    })
}

export const postMethodCommon = function (_url, data) {
    return service({
        url: _url,
        method: 'POST',
        data,
        headers:{
            'X-Token': localStorage.getItem("Token")   
        }
    })
}

export const postMethodCommon1 = function (_url, data) {
    return service({
        url: _url,
        method: 'POST',
        data,
        headers:{
            'token': localStorage.getItem("Token")   
        },
        responseType: 'blob',
    })
}


// export const getShpTable = function (params) {
//     return service({
//       url: '/ShpManager/SearchShpTable',
//       method: 'get',
//       params
//     })
// }

// export const getKjLoad = function (params) {
//     return service({
//       url: '/Categorys/Load',
//       method: 'get',
//       params
//     })
// }
