update web/src/api/service.js.

Signed-off-by: JackLu2021 <675599689@qq.com>
pull/83/head
JackLu2021 2022-12-23 02:32:33 +00:00 committed by Gitee
parent a8cfe687a2
commit ece8438339
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -224,7 +224,7 @@ export const downloadFile = function ({ url, params, method, filename }) {
responseType: 'blob'
// headers: {Accept: 'application/vnd.openxmlformats-officedocument'}
}).then(res => {
const fileName = window.decodeURI((filename === undefined ? false : filename + '.xls') || res.headers['content-disposition'].split('=')[1]) || '文件导出.xls'
const fileName = (filename === undefined ? false : filename + '.xls') || decodeURI(res.headers['content-disposition'].split('=')[1]) || '文件导出.xls'
if (res) {
const blob = new Blob([res.data], { type: 'charset=utf-8' })
const elink = document.createElement('a')