import request from '@/utils/request'

export const api = {
  upload: '/file/upload',
  uploadToy: '/toy/info/importData'
}

export function uploadFile(data, onUploadProgress, cancelToken) {
  return request({
    url: api.upload,
    method: 'post',
    data,
    headers: {
      'repeatSubmit': false // 可重复提交
    },
    onUploadProgress,
    cancelToken
  })
}

// 玩具库
export function uploadToy(data) {
  return request({
    url: api.uploadToy,
    method: 'post',
    data
  })
}

