import { saveAs } from 'file-saver'

export default function downLoadFile1(url: string, name: string) {
  console.log(url, name)
  const oReq = new XMLHttpRequest()
  oReq.open('GET', url, true)
  oReq.responseType = 'blob'
  oReq.onload = function () {
    const file = new Blob([oReq.response], {
      type: 'blob',
    })
    saveAs.saveAs(file, name)
  }
  oReq.send()
}
