From a59238d93caa373fe65ca932515aba7a5b3d93ca Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 18 Dec 2020 12:46:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E6=AD=A5?= =?UTF-8?q?=E9=AA=A4=E7=A7=BB=E9=99=A4=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/api/service/ApiDefinitionService.java | 2 ++ backend/src/main/java/io/metersphere/xpack | 2 +- .../components/api/automation/scenario/EditApiScenario.vue | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index c708e19d9c..d82500fcfa 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -201,6 +201,7 @@ public class ApiDefinitionService { test.setName(request.getName()); test.setPath(request.getPath()); test.setProjectId(request.getProjectId()); + request.getRequest().setId(request.getId()); test.setRequest(JSONObject.toJSONString(request.getRequest())); test.setUpdateTime(System.currentTimeMillis()); test.setStatus(request.getStatus()); @@ -227,6 +228,7 @@ public class ApiDefinitionService { test.setPath(request.getPath()); test.setModuleId(request.getModuleId()); test.setProjectId(request.getProjectId()); + request.getRequest().setId(request.getId()); test.setRequest(JSONObject.toJSONString(request.getRequest())); test.setCreateTime(System.currentTimeMillis()); test.setUpdateTime(System.currentTimeMillis()); diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index efb49c9b4b..61397c1672 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit efb49c9b4be136ce48e9550dc9c8a2975d9f4d7f +Subproject commit 61397c16728a63493507679f7e0940d9099f337f diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index 3dacc7a663..0136fad3e7 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -552,7 +552,7 @@ remove(row, node) { const parent = node.parent const hashTree = parent.data.hashTree || parent.data; - const index = hashTree.findIndex(d => d.id != undefined && row.id != undefined && d.id === row.id) + const index = hashTree.findIndex(d => d.resourceId != undefined && row.resourceId != undefined && d.resourceId === row.resourceId) hashTree.splice(index, 1); this.sort(); this.reload(); From 602e5009268ef6280284b37dcbb62eee410da425 Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Fri, 18 Dec 2020 12:58:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E9=A6=96=E9=A1=B5=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/business/components/api/router.js | 1 - .../components/common/head/HeaderTopMenus.vue | 21 ++++++++++++++----- frontend/src/business/components/xpack | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/frontend/src/business/components/api/router.js b/frontend/src/business/components/api/router.js index ab570f38ac..3b32bbc216 100644 --- a/frontend/src/business/components/api/router.js +++ b/frontend/src/business/components/api/router.js @@ -3,7 +3,6 @@ import MsProject from "@/business/components/settings/project/MsProject"; export default { path: "/api", name: "api", - redirect: "/api/home", components: { content: () => import('@/business/components/api/ApiTest') }, diff --git a/frontend/src/business/components/common/head/HeaderTopMenus.vue b/frontend/src/business/components/common/head/HeaderTopMenus.vue index 57907d9c7a..a8fb2db8eb 100644 --- a/frontend/src/business/components/common/head/HeaderTopMenus.vue +++ b/frontend/src/business/components/common/head/HeaderTopMenus.vue @@ -9,17 +9,17 @@ router> - {{$t('test_track.test_track')}} + {{ $t('test_track.test_track') }} - - {{$t('commons.api')}} + + {{ $t('commons.api') }} - {{$t('commons.performance')}} + {{ $t('commons.performance') }} - {{$t('commons.system_setting')}} + {{ $t('commons.system_setting') }} @@ -47,7 +47,18 @@ }, methods: { handleSelect(index) { + console.log(index) this.activeIndex = index + + }, + active() { + if (this.activeIndex === '/api') { + if (this.$store.state.switch.value == 'new') { + window.location.href = "/#/api/home"; + } else if (this.$store.state.switch.value == 'old') { + window.location.href = "/#/api/home_obsolete"; + } + } } } } diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index d39dafaf84..010ad7a5f0 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit d39dafaf84b9c7a56cb51f2caf67dd7dfde5938c +Subproject commit 010ad7a5f072a5e9d368c756a2473bbd20781433