diff --git a/frontend/src/views/JobDetailView.vue b/frontend/src/views/JobDetailView.vue index 920e3e7..1541d74 100644 --- a/frontend/src/views/JobDetailView.vue +++ b/frontend/src/views/JobDetailView.vue @@ -466,7 +466,7 @@ const downloadCombinedFile = async () => { const response = await filesAPI.downloadCombineFile(jobUuid.value) // 從響應頭獲取檔案名 - let filename = 'combined_file.xlsx' + let filename = 'combined_file.docx' if (response.headers && response.headers['content-disposition']) { const contentDisposition = response.headers['content-disposition'] const match = contentDisposition.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/) @@ -476,8 +476,14 @@ const downloadCombinedFile = async () => { } else { // 使用預設檔名或從任務資料獲取 const originalName = job.value.original_filename - const baseName = originalName ? originalName.split('.')[0] : 'combined' - filename = `combined_${baseName}.xlsx` + if (originalName) { + const nameParts = originalName.split('.') + const baseName = nameParts.slice(0, -1).join('.') + const extension = nameParts[nameParts.length - 1] + filename = `combined_${baseName}.${extension}` + } else { + filename = 'combined_file.docx' + } } // 創建下載連結