fix: 许可证下载文件名称从响应头中的Content-Disposition获取

This commit is contained in:
hanyuxia
2024-03-20 11:01:09 +08:00
parent c7b7a0a773
commit 8a18fb09f4

View File

@@ -108,7 +108,11 @@ export default {
},
downloadFile () {
axios.get(this.downloadC2vUrl, { responseType: 'blob' }).then(res => {
const fileName = 'CN-' + this.licenseObject.supportID + '-license-apply.xml'
let fileName = ''
if(res.headers['content-disposition']) {
fileName = res.headers['content-disposition'].split(';')[1].split('filename=')[1]
}
if (window.navigator.msSaveOrOpenBlob) {
// 兼容ie11
const blobObject = new Blob([res.data])