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