import axios from 'axios';

export function handleDownLoadFile(response: Blob, fileName: string) {
  const blob = new Blob([response], { type: 'application/vnd.ms-excel' });
  const src = window.URL.createObjectURL(blob);
  if (src) {
    const link = document.createElement('a');
    link.href = src;
    link.setAttribute('download', fileName); // 设置文件名
    document.body.appendChild(link);
    link.click();
    link.remove();
  }
}

export function getAPIBaseUrl() {
  return axios.defaults.baseURL ? axios.defaults.baseURL : '';
}

export default null;
