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; },