Commit 306c9c3e by wusiyi

fix: 批量下载bug修复

parent bcd49c5c
...@@ -1910,15 +1910,14 @@ const handleDownload = async (row: PodUsOrderListData) => { ...@@ -1910,15 +1910,14 @@ const handleDownload = async (row: PodUsOrderListData) => {
try { try {
const res = await batchDownloadDownloadApi({ id: row.id }) const res = await batchDownloadDownloadApi({ id: row.id })
if (res.code !== 200 || !res.message) return if (res.code !== 200 || !res.message) return
const url = filePath + res.message
fetch(res.message) fetch(url)
.then((res) => res.blob()) .then((res) => res.blob())
.then((blob) => { .then((blob) => {
const link = document.createElement('a') const link = document.createElement('a')
link.href = URL.createObjectURL(blob) link.href = URL.createObjectURL(blob)
link.download = res.message link.download = url ? url.split('/').pop() || 'download' : 'download'
? res.message.split('/').pop() || 'download'
: 'download'
link.click() link.click()
}) })
ElMessage.success('操作成功') ElMessage.success('操作成功')
......
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