import axios from './axios'
export function uploadImg(file, params = {}) {
  const from = new FormData()
  from.append('file', file)
  const { url, ...otherParams } = params
  for (const key in otherParams) {
    from.append(key, otherParams[key])
  }
  return axios.post(url || 'upload/fileUpload/images', from, {
    headers: { 'content-type': 'multipart/form-data' },
  })
}