import { stringify } from 'qs'
import { request } from '@umijs/max'
import webpath from '@/utils/webPath'

export async function uploadSingleFile(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/uploading/uploadSingleFile`, {
        method: 'POST',
        data: params,
        timeout: 120000
    })
}

export async function downloadFile(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/uploading/download?${stringify(params)}`, {
        responseType: 'blob',
        getResponse: true
    })
}
