refactor: 下载jtl
This commit is contained in:
parent
b9e79cec6e
commit
abd12d5d77
|
@ -279,7 +279,7 @@ public class ReportService {
|
|||
public byte[] downloadJtl(String reportId) {
|
||||
LoadTestReportWithBLOBs report = getReport(reportId);
|
||||
if (StringUtils.isBlank(report.getFileId())) {
|
||||
MSException.throwException(Translator.get("load_test_report_file_not_exist"));
|
||||
throw new RuntimeException(Translator.get("load_test_report_file_not_exist"));
|
||||
}
|
||||
return fileService.loadFileAsBytes(report.getFileId());
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
{{ $t('test_track.plan_view.export_report') }}
|
||||
</el-button>
|
||||
<el-button :disabled="isReadOnly" type="warning" plain size="mini" @click="downloadJtl()">
|
||||
下载JTL
|
||||
{{ $t('report.downloadJtl') }}
|
||||
</el-button>
|
||||
|
||||
<!--<el-button :disabled="isReadOnly" type="warning" plain size="mini">-->
|
||||
|
@ -307,7 +307,10 @@ export default {
|
|||
navigator.msSaveBlob(blob, this.filename)
|
||||
}
|
||||
}).catch(e => {
|
||||
Message.error({message: e.message, showClose: true});
|
||||
let text = e.response.data.text();
|
||||
text.then((data) => {
|
||||
Message.error({message: JSON.parse(data).message || e.message, showClose: true});
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue