|
@@ -141,6 +141,7 @@ const mixins = {
|
|
|
const b=new http.Base64()
|
|
|
const arr=url.split('/')
|
|
|
const _fileName=arr[arr.length-1]
|
|
|
+ const _fileType= _fileName.substring(_fileName.lastIndexOf(".") + 1)
|
|
|
const fileNameTypeArr = fileName.split('.')
|
|
|
const _fileNameTypeArr = _fileName.split('.')
|
|
|
const fileNameType = fileNameTypeArr.length>1?fileNameTypeArr[fileNameTypeArr.length-1]:''
|
|
@@ -160,7 +161,7 @@ const mixins = {
|
|
|
const blob = new Blob([content])
|
|
|
if ('download' in document.createElement('a')) {
|
|
|
const elink = document.createElement('a')
|
|
|
- elink.download = fileNameType?fileName:(fileName+'.'+_fileNameType)
|
|
|
+ elink.download = fileName+'.'+_fileType
|
|
|
elink.style.display = 'none'
|
|
|
elink.href = window.URL.createObjectURL(blob)
|
|
|
document.body.appendChild(elink)
|
|
@@ -168,7 +169,7 @@ const mixins = {
|
|
|
window.URL.revokeObjectURL(elink.href)
|
|
|
document.body.removeChild(elink)
|
|
|
} else {
|
|
|
- navigator.msSaveBlob(blob, fileNameType?fileName:(fileName+'.'+_fileNameType))
|
|
|
+ navigator.msSaveBlob(blob, fileName+'.'+_fileType)
|
|
|
}
|
|
|
successCb&&successCb()
|
|
|
}).catch(()=>{
|