fix(性能测试): 修复性能测试分享报告下载详细日志报错的问题

--bug=1010395 --user=刘瑞斌 【性能测试】-报告分享后用浏览器打开查看-日志详情-下载完整日志文件不可用 https://www.tapd.cn/55049933/s/1106788
This commit is contained in:
CaptainB 2022-02-21 17:10:54 +08:00 committed by 刘瑞斌
parent b1aa01fb7d
commit dc11835f32
2 changed files with 10 additions and 1 deletions

View File

@ -257,6 +257,11 @@ public class ShareController {
return performanceReportService.getReportLogResource(reportId);
}
@GetMapping("/performance/report/log/download/{reportId}/{resourceId}")
public void downloadLog(@PathVariable String reportId, @PathVariable String resourceId, HttpServletResponse response) throws Exception {
performanceReportService.downloadLog(response, reportId, resourceId);
}
@GetMapping("/performance/report/log/{shareId}/{reportId}/{resourceId}/{goPage}")
public Pager<List<LoadTestReportLog>> logs(@PathVariable String shareId, @PathVariable String reportId, @PathVariable String resourceId, @PathVariable int goPage) {
Page<Object> page = PageHelper.startPage(goPage, 1, true);

View File

@ -116,8 +116,12 @@ export default {
this.load(instance);
},
downloadLogFile(resourceId) {
let url = '/performance/report/log/download/' + this.id + '/' + resourceId;
if (this.isShare) {
url = '/share/performance/report/log/download/' + this.id + '/' + resourceId;
}
let config = {
url: '/performance/report/log/download/' + this.id + '/' + resourceId,
url: url,
method: 'get',
responseType: 'blob'
};