fuliqi
2024-07-08 4d8f0c85660d7dd77199e86e9af9e945a1611e52
src/utils/request.js
@@ -104,10 +104,25 @@
  return request(false, query)
}
const download = function (url, params) {
  const query = {
    baseURL: process.env.VUE_APP_URL,
    url: url,
    method: 'get',
    withCredentials: true,
    timeout: 300000,
    params: params,
    responseType: 'blob', // 关键
    headers: { 'Content-Type': 'application/vnd.ms-excel' }// 类型修改为excel
  }
  return request(false, query)
}
export {
  post,
  postWithLoadTip,
  postWithOutLoadTip,
  get,
  form
  form,
  download
}