导出文件格式问题
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-06-18 14:28:08 +08:00
parent 6980cd275e
commit fead8b8c8f
1 changed files with 2 additions and 1 deletions

View File

@ -50,7 +50,8 @@ service.interceptors.response.use(
const a = document.createElement('a')
// xls类型: application/vnd.ms-excel
// xlsx类型application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
const href = URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' }))
// const href = URL.createObjectURL(new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' }))
const href = URL.createObjectURL(new Blob([res], { type: response.headers['content-type'] }))
a.download = fileName
a.href = href
a.click()