From cda0f5b969cb69b66c5642d5ac6c48bc8465f22b Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 22 Apr 2021 16:54:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=B7=A5=E4=BD=9C=E7=A9=BA=E9=97=B4=E5=90=8E?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E8=AE=A1=E5=88=92=E5=88=97=E8=A1=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9C=AA=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/track/controller/TestPlanController.java | 6 +++--- .../java/io/metersphere/track/service/TestPlanService.java | 4 ++-- .../src/business/components/track/head/TrackHeaderMenus.vue | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java index 3942c92a74..1d9dd6845a 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java @@ -70,10 +70,10 @@ public class TestPlanController { return testPlanService.listRelateAllPlan(); } - @GetMapping("recent/{count}") - public List recentTestPlans(@PathVariable int count) { + @GetMapping("recent/{count}/{id}") + public List recentTestPlans(@PathVariable("count") int count, @PathVariable("id") String projectId) { PageHelper.startPage(1, count, true); - return testPlanService.recentTestPlans(); + return testPlanService.recentTestPlans(projectId); } @PostMapping("/get/{testPlanId}") diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index b601b379fd..b392c9bebb 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -562,8 +562,8 @@ public class TestPlanService { } } - public List recentTestPlans() { - return extTestPlanMapper.listRecent(SessionUtils.getUserId(), SessionUtils.getCurrentProjectId()); + public List recentTestPlans(String projectId) { + return extTestPlanMapper.listRecent(SessionUtils.getUserId(), projectId); } public List listTestAllPlan(String currentWorkspaceId) { diff --git a/frontend/src/business/components/track/head/TrackHeaderMenus.vue b/frontend/src/business/components/track/head/TrackHeaderMenus.vue index b2dcd0603d..a3ae171ba9 100644 --- a/frontend/src/business/components/track/head/TrackHeaderMenus.vue +++ b/frontend/src/business/components/track/head/TrackHeaderMenus.vue @@ -101,7 +101,7 @@ export default { }, planRecent: { title: this.$t('test_track.recent_plan'), - url: "/test/plan/recent/5", + url: this.$store.state.projectId === '' ? "/test/plan/recent/5/" + undefined : "/test/plan/recent/5/" + this.$store.state.projectId, index: function (item) { return '/track/plan/view/' + item.id; },