커뮤니티 파일 다운로드 수정
This commit is contained in:
parent
7179b2bdca
commit
ca9c20bd37
@ -8,8 +8,10 @@ export const handleFileDown = async (file) => {
|
|||||||
const params = new URLSearchParams({
|
const params = new URLSearchParams({
|
||||||
encodeFileNo: file.encodeFileNo,
|
encodeFileNo: file.encodeFileNo,
|
||||||
})
|
})
|
||||||
|
const options = { responseType: 'blob' }
|
||||||
const apiUrl = `${url}?${params.toString()}`
|
const apiUrl = `${url}?${params.toString()}`
|
||||||
await promiseGet({ url: apiUrl, responseType: 'blob' })
|
|
||||||
|
await promiseGet({ url: apiUrl, option: options })
|
||||||
.then((resultData) => {
|
.then((resultData) => {
|
||||||
if (resultData) {
|
if (resultData) {
|
||||||
const blob = new Blob([resultData.data], { type: resultData.headers['content-type'] || 'application/octet-stream' })
|
const blob = new Blob([resultData.data], { type: resultData.headers['content-type'] || 'application/octet-stream' })
|
||||||
@ -25,7 +27,7 @@ export const handleFileDown = async (file) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
alert(error.response.data.message)
|
alert('File does not exist.')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user