diff --git a/backend/src/main/java/io/metersphere/api/service/ShareInfoService.java b/backend/src/main/java/io/metersphere/api/service/ShareInfoService.java index 808d393fce..afe125d583 100644 --- a/backend/src/main/java/io/metersphere/api/service/ShareInfoService.java +++ b/backend/src/main/java/io/metersphere/api/service/ShareInfoService.java @@ -597,10 +597,10 @@ public class ShareInfoService { ShareInfoService shareInfoService = CommonBeanFactory.getBean(ShareInfoService.class); shareInfoService.validateExpired(shareInfo); if (shareInfo == null) { - MSException.throwException("shareInfo not exist!"); + MSException.throwException("ShareInfo not exist!"); } else { if (!StringUtils.equals(customData, shareInfo.getCustomData())) { - MSException.throwException("validate failure!"); + MSException.throwException("ShareInfo validate failure!"); } } } diff --git a/backend/src/main/java/io/metersphere/controller/ShareController.java b/backend/src/main/java/io/metersphere/controller/ShareController.java index e8f72ee24e..edc014b14c 100644 --- a/backend/src/main/java/io/metersphere/controller/ShareController.java +++ b/backend/src/main/java/io/metersphere/controller/ShareController.java @@ -168,7 +168,7 @@ public class ShareController { @GetMapping("/api/definition/report/getReport/{shareId}/{testId}") public APIReportResult getApiReport(@PathVariable String shareId, @PathVariable String testId) { -// shareInfoService.apiReportValidate(shareId, testId); + shareInfoService.validateExpired(shareId); return apiDefinitionService.getDbResult(testId); } @@ -180,25 +180,25 @@ public class ShareController { @GetMapping("/performance/report/{shareId}/{reportId}") public ReportDTO getLoadTestReport(@PathVariable String shareId, @PathVariable String reportId) { - //todo + shareInfoService.validateExpired(shareId); return performanceReportService.getReportTestAndProInfo(reportId); } @GetMapping("/performance/report/content/report_time/{shareId}/{reportId}") public ReportTimeInfo getReportTimeInfo(@PathVariable String shareId, @PathVariable String reportId) { - // todo + shareInfoService.validateExpired(shareId); return performanceReportService.getReportTimeInfo(reportId); } @PostMapping("/test/plan/load/case/report/exist/{shareId}") public Boolean isExistReport(@PathVariable String shareId, @RequestBody LoadCaseReportRequest request) { - // testPlanLoadCaseService todo checkout + shareInfoService.validateExpired(shareId); return testPlanLoadCaseService.isExistReport(request); } @GetMapping("/performance/report/get-advanced-config/{shareId}/{reportId}") public String getAdvancedConfig(@PathVariable String shareId, @PathVariable String reportId) { - shareInfoService.validate(shareId, reportId); + shareInfoService.validateExpired(shareId); return performanceReportService.getAdvancedConfiguration(reportId); } @@ -209,12 +209,13 @@ public class ShareController { @GetMapping("/performance/report/get-jmx-content/{shareId}/{reportId}") public LoadTestExportJmx getJmxContent(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getJmxContent(reportId).get(0); } @GetMapping("/performance/get-jmx-content/{shareId}/{testId}") public List getOldJmxContent(@PathVariable String shareId, @PathVariable String testId) { -// checkPermissionService.checkPerformanceTestOwner(testId); + shareInfoService.validateExpired(shareId); return performanceTestService.getJmxContent(testId); } @@ -226,51 +227,61 @@ public class ShareController { @GetMapping("/performance/report/content/testoverview/{shareId}/{reportId}") public TestOverview getTestOverview(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getTestOverview(reportId); } @GetMapping("/performance/report/content/load_chart/{shareId}/{reportId}") public List getLoadChartData(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getLoadChartData(reportId); } @GetMapping("/performance/report/content/res_chart/{shareId}/{reportId}") public List getResponseTimeChartData(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getResponseTimeChartData(reportId); } @GetMapping("/performance/report/content/error_chart/{shareId}/{reportId}") public List getErrorChartData(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getErrorChartData(reportId); } @GetMapping("/performance/report/content/response_code_chart/{shareId}/{reportId}") public List getResponseCodeChartData(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getResponseCodeChartData(reportId); } @GetMapping("/performance/report/content/{shareId}/{reportKey}/{reportId}") public List getReportChart(@PathVariable String shareId, @PathVariable String reportKey, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getReportChart(reportKey, reportId); } @GetMapping("/performance/report/content/{shareId}/{reportId}") public List getReportContent(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getReportStatistics(reportId); } @GetMapping("/performance/report/content/errors/{shareId}/{reportId}") public List getReportErrors(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getReportErrors(reportId); } @GetMapping("/performance/report/content/errors_top5/{shareId}/{reportId}") public List getReportErrorsTop5(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getReportErrorsTOP5(reportId); } @GetMapping("/performance/report/log/resource/{shareId}/{reportId}") public List getResourceIds(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getReportLogResource(reportId); } @@ -281,23 +292,26 @@ public class ShareController { @GetMapping("/performance/report/log/{shareId}/{reportId}/{resourceId}/{goPage}") public Pager> logs(@PathVariable String shareId, @PathVariable String reportId, @PathVariable String resourceId, @PathVariable int goPage) { + shareInfoService.validateExpired(shareId); Page page = PageHelper.startPage(goPage, 1, true); return PageUtils.setPageInfo(page, performanceReportService.getReportLogs(reportId, resourceId)); } @GetMapping("/metric/query/{shareId}/{id}") public List queryMetric(@PathVariable String shareId, @PathVariable("id") String reportId) { + shareInfoService.validateExpired(shareId); return metricService.queryMetric(reportId); } @GetMapping("/metric/query/resource/{shareId}/{id}") public List queryReportResource(@PathVariable String shareId, @PathVariable("id") String reportId) { + shareInfoService.validateExpired(shareId); return metricService.queryReportResource(reportId); } @GetMapping("/performance/report/get-load-config/{shareId}/{testId}") public String getLoadConfiguration(@PathVariable String shareId, @PathVariable String testId) { - //checkPermissionService.checkPerformanceTestOwner(testId); + shareInfoService.validateExpired(shareId); return performanceTestService.getLoadConfiguration(testId); } diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/LoadAllResult.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/LoadAllResult.vue index d0f10a7ae4..c88f9cf6c3 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/LoadAllResult.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/LoadAllResult.vue @@ -1,13 +1,26 @@