diff --git a/backend/src/main/java/io/metersphere/controller/ShareController.java b/backend/src/main/java/io/metersphere/controller/ShareController.java index e67bcc48ed..f8899dab0c 100644 --- a/backend/src/main/java/io/metersphere/controller/ShareController.java +++ b/backend/src/main/java/io/metersphere/controller/ShareController.java @@ -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> logs(@PathVariable String shareId, @PathVariable String reportId, @PathVariable String resourceId, @PathVariable int goPage) { Page page = PageHelper.startPage(goPage, 1, true); diff --git a/frontend/src/business/components/performance/report/components/LogDetails.vue b/frontend/src/business/components/performance/report/components/LogDetails.vue index 27875578e8..658825c424 100644 --- a/frontend/src/business/components/performance/report/components/LogDetails.vue +++ b/frontend/src/business/components/performance/report/components/LogDetails.vue @@ -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' };