From 1de3e7302f6af4beda472d898ee9862335b48909 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 29 Nov 2023 19:09:03 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=B9=B6=E7=BB=A7=E7=BB=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --story=1013901 --user=赵勇 【接口测试】接口case新增“保存并继续添加”按钮 https://www.tapd.cn/55049933/s/1439638 Signed-off-by: fit2-zhao --- .../components/case/ApiCaseHeader.vue | 23 +++++++++---------- .../components/case/ApiCaseItem.vue | 11 +++++---- .../org/apache/jmeter/util/SSLManager.java | 4 ++-- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/api-test/frontend/src/business/definition/components/case/ApiCaseHeader.vue b/api-test/frontend/src/business/definition/components/case/ApiCaseHeader.vue index d0dbf9642e..64dd47e23f 100644 --- a/api-test/frontend/src/business/definition/components/case/ApiCaseHeader.vue +++ b/api-test/frontend/src/business/definition/components/case/ApiCaseHeader.vue @@ -42,18 +42,6 @@ style="margin-left: -20px"> {{ saveButtonText }} - - - {{ $t('home.dashboard.api_case.save_and_create') }} - - + + + {{ $t('home.dashboard.api_case.save_and_create') }} + diff --git a/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue b/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue index 8e88a7a0a6..1ca8d01a46 100644 --- a/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue +++ b/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue @@ -623,10 +623,10 @@ export default { data.method = data.protocol; } }, - addModule(row) { - this.saveApi(row, 'default-module'); + addModule(row, created) { + this.saveApi(row, 'default-module', created); }, - saveApi(row, module) { + saveApi(row, module, created) { let data = this.api; data.name = this.apiCase.name; data.moduleId = module; @@ -639,6 +639,9 @@ export default { row.apiDefinitionId = data.id; this.saveCase(row); } + if (created) { + this.$emit('addCase'); + } }); }, reload() { @@ -761,7 +764,7 @@ export default { if (this.compare.indexOf(row.id) === -1) { this.compare.push(row.id); if (this.api.saved) { - this.addModule(row); + this.addModule(row, created); } else { this.api.source = 'editCase'; if (!this.isSave) { diff --git a/framework/sdk-parent/jmeter/src/main/java/org/apache/jmeter/util/SSLManager.java b/framework/sdk-parent/jmeter/src/main/java/org/apache/jmeter/util/SSLManager.java index 23728225b6..2ef115327b 100644 --- a/framework/sdk-parent/jmeter/src/main/java/org/apache/jmeter/util/SSLManager.java +++ b/framework/sdk-parent/jmeter/src/main/java/org/apache/jmeter/util/SSLManager.java @@ -151,8 +151,8 @@ public abstract class SSLManager { JMeterContext threadContext = JMeterContextService.getContext(); if (threadContext != null && threadContext.getCurrentSampler() != null) { String resourceId = threadContext.getCurrentSampler().getPropertyAsString("MS-RESOURCE-ID"); - log.info("重新加载认证文件{}", resourceId); if (StringUtils.isNotBlank(resourceId) && keyMap.containsKey(resourceId)) { + log.info("重新加载认证文件{}", resourceId); KeystoreDTO dto = keyMap.get(resourceId); // 加载认证文件 try (InputStream in = new FileInputStream(new File(dto.getPath()))) { @@ -372,8 +372,8 @@ public abstract class SSLManager { JMeterContext threadContext = JMeterContextService.getContext(); if (threadContext != null && threadContext.getCurrentSampler() != null) { String resourceId = threadContext.getCurrentSampler().getPropertyAsString("MS-RESOURCE-ID"); - log.info("重新加载认证文件{}", resourceId); if (StringUtils.isNotBlank(resourceId) && keyMap.containsKey(resourceId)) { + log.info("重新加载认证文件{}", resourceId); KeystoreDTO dto = keyMap.get(resourceId); SSLManager.manager = new JsseSSLManager(null); SSLManager.manager.keyStore = null;