fix: 修复下载license时文件名不对的问题

This commit is contained in:
chenjinsong
2024-03-19 15:38:46 +08:00
parent 2357701525
commit da0156031c

View File

@@ -138,7 +138,8 @@ export default {
},
downloadFile () {
axios.get(this.downloadC2vUrl, { responseType: 'blob' }).then(res => {
const fileName = 'CN-' + this.supportID + '-license-apply.xml'
const disposition = res.headers['content-disposition']
const fileName = decodeURI(disposition.split('filename=')[1])
if (window.navigator.msSaveOrOpenBlob) {
// 兼容ie11
const blobObject = new Blob([res.data])
@@ -229,13 +230,6 @@ export default {
async mounted () {
this.queryAppearance()
this.checkLicenseStatus()
await axios.get(api.license).then(res => {
if (res.status === 200) {
this.supportID = res.data.data.license.supportID
}
}).catch(e => {
console.log(e)
})
},
setup (props) {
const { currentRoute } = useRouter()