import service from '@/utils/request'

export const uploadService = (userAgent,file) => {
  const formData = new FormData()
  formData.append('file', file)
  return service({
    url: `${userAgent}/upload`,
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

export const getUploadTokenService = (userAgent) => {
  return service({
    url: `${userAgent}/getUploadToken`,
    method: 'get'
  })
}

export const getConfigService = (userAgent,fileType) => {
  return service({
    url: `${userAgent}/getConfig?fileType=${fileType}`,
    method: 'get'
  })
}