Commit 6a0ecb04 by qinjianhui

feat: 批次素材下载改为直接下载而非新窗口打开

parent 01701ca7
......@@ -487,7 +487,16 @@ const handleDownload = async (row: BatchManageData) => {
try {
const res = await downloadBatchMaterialApi(row.id, type)
if (res.code !== 200) return
window.open(filePath + res.message, '_blank')
if (type === 'tiff') {
window.open(filePath + res.message, '_blank')
} else {
const a = document.createElement('a')
a.href = filePath + res.message
a.download = res.message?.split('/').pop() || 'download'
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
}
} catch (e) {
console.error(e)
} finally {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment