diff --git a/jeecgboot-vue3/src/api/common/api.ts b/jeecgboot-vue3/src/api/common/api.ts index 47d5cfbb..c1c35308 100644 --- a/jeecgboot-vue3/src/api/common/api.ts +++ b/jeecgboot-vue3/src/api/common/api.ts @@ -112,8 +112,8 @@ export const downloadFile = (url, fileName?, parameter?) => { if (typeof window.navigator.msSaveBlob !== 'undefined') { window.navigator.msSaveBlob(new Blob([data]), fileName); } else { - let url = window.URL.createObjectURL(new Blob([data])); - let link = document.createElement('a'); + const url = window.URL.createObjectURL(new Blob([data])); + const link = document.createElement('a'); link.style.display = 'none'; link.href = url; link.setAttribute('download', fileName); diff --git a/jeecgboot-vue3/types/global.d.ts b/jeecgboot-vue3/types/global.d.ts index 51487325..13607fc0 100644 --- a/jeecgboot-vue3/types/global.d.ts +++ b/jeecgboot-vue3/types/global.d.ts @@ -80,6 +80,11 @@ declare global { [elem: string]: any; } } + + interface Navigator { + // fix:msSaveBlob dose exist on type Navigator + msSaveBlob?: (blob: any, defaultName?: string) => boolean; + } } declare module 'vue' {