|
|
@@ -1675,10 +1675,12 @@ export default () => {
|
|
|
exporting.value = true
|
|
|
imgExporting.value = true
|
|
|
startTimer?.()
|
|
|
+ const oneHour = 60 * 60 * 1000
|
|
|
// 1. 上传文件到 ConvertAPI
|
|
|
fetch(`https://v2.convertapi.com/upload?filename=${encodeURIComponent(file.name)}`, {
|
|
|
method: 'POST',
|
|
|
body: file,
|
|
|
+ signal: AbortSignal.timeout(oneHour),
|
|
|
})
|
|
|
.then(r => r.json())
|
|
|
.then(uploadRes => {
|
|
|
@@ -1689,13 +1691,14 @@ export default () => {
|
|
|
method: 'POST',
|
|
|
headers: { 'Content-Type': 'application/json' },
|
|
|
body: JSON.stringify(body),
|
|
|
+ signal: AbortSignal.timeout(oneHour),
|
|
|
}).then(r => r.json())
|
|
|
})
|
|
|
.then(convRes => {
|
|
|
const fileUrl = convRes?.Files?.[0]?.Url
|
|
|
console.log('转换成功:', fileUrl)
|
|
|
if (!fileUrl) throw new Error('转换失败:未获取到文件')
|
|
|
- return fetch(fileUrl)
|
|
|
+ return fetch(fileUrl, { signal: AbortSignal.timeout(oneHour) })
|
|
|
})
|
|
|
.then(res => res.arrayBuffer())
|
|
|
.then(buffer => {
|