diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java index f8c9895250..3a90c6976d 100644 --- a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java +++ b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java @@ -335,7 +335,7 @@ public class ApiAutomationController { return apiAutomationService.setDomain(request.getDefinition()); } - @PostMapping(value = "/export/jmx") + @PostMapping(value = "/export/zip") @RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_EXPORT_SCENARIO) @MsAuditLog(module = "api_automation", type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") public ResponseEntity downloadBodyFiles(@RequestBody ApiScenarioBatchRequest request) { @@ -345,5 +345,13 @@ public class ApiAutomationController { .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + "场景JMX文件集.zip") .body(bytes); } + + @PostMapping(value = "/export/jmx") + @RequiresPermissions(PermissionConstants.PROJECT_API_SCENARIO_READ_EXPORT_SCENARIO) + @MsAuditLog(module = "api_automation", type = OperLogConstants.EXPORT, sourceId = "#request.id", title = "#request.name", project = "#request.projectId") + public List exportJmx(@RequestBody ApiScenarioBatchRequest request) { + return apiAutomationService.exportJmx(request); + } + } diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue index 92b550de7d..08d638a560 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue @@ -253,6 +253,7 @@ import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOpe import {editApiScenarioCaseOrder} from "@/business/components/api/automation/api-automation"; import {TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting"; import axios from "axios"; +import {error} from "@/common/js/message"; export default { name: "MsApiScenarioList", @@ -1031,6 +1032,9 @@ export default { link.download = "场景JMX文件集.zip"; this.result.loading = false; link.click(); + },error => { + this.result.loading = false; + this.$error("导出JMX文件失败"); }); }, @@ -1042,7 +1046,7 @@ export default { return; } this.result.loading = true; - this.fileDownload("/api/automation/export/jmx", param); + this.fileDownload("/api/automation/export/zip", param); }, getConditions() { return this.condition;