fix(测试用例): 导出-修复下载文件缺陷
This commit is contained in:
parent
6a67b6d859
commit
b26d7de88d
|
@ -466,7 +466,10 @@ export function checkCaseExportTask() {
|
|||
}
|
||||
// 获取导出的文件
|
||||
export function getCaseDownloadFile(projectId: string, fileId: string) {
|
||||
return MSR.get({ url: `${GetCaseDownloadFileUrl}/${projectId}/${fileId}` });
|
||||
return MSR.get(
|
||||
{ url: `${GetCaseDownloadFileUrl}/${projectId}/${fileId}`, responseType: 'blob' },
|
||||
{ isTransformResponse: false, isReturnNativeResponse: true }
|
||||
);
|
||||
}
|
||||
// 停止导出
|
||||
export function stopCaseExport(taskId: string) {
|
||||
|
|
|
@ -1095,7 +1095,7 @@
|
|||
try {
|
||||
const response = await getCaseDownloadFile(currentProjectId.value, reportId.value);
|
||||
const fileName = response?.headers.get('content-disposition').split('filename=')[1];
|
||||
downloadByteFile(response.blob(), fileName);
|
||||
downloadByteFile(response.data, fileName);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
|
|
Loading…
Reference in New Issue