update web/src/api/service.js.
Signed-off-by: JackLu2021 <675599689@qq.com>pull/83/head
parent
a8cfe687a2
commit
ece8438339
|
@ -224,7 +224,7 @@ export const downloadFile = function ({ url, params, method, filename }) {
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
// headers: {Accept: 'application/vnd.openxmlformats-officedocument'}
|
// headers: {Accept: 'application/vnd.openxmlformats-officedocument'}
|
||||||
}).then(res => {
|
}).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) {
|
if (res) {
|
||||||
const blob = new Blob([res.data], { type: 'charset=utf-8' })
|
const blob = new Blob([res.data], { type: 'charset=utf-8' })
|
||||||
const elink = document.createElement('a')
|
const elink = document.createElement('a')
|
||||||
|
|
Loading…
Reference in New Issue