diff --git a/test-track/frontend/src/business/case/components/TestCaseEdit.vue b/test-track/frontend/src/business/case/components/TestCaseEdit.vue index f2808fe742..258dc0fb06 100644 --- a/test-track/frontend/src/business/case/components/TestCaseEdit.vue +++ b/test-track/frontend/src/business/case/components/TestCaseEdit.vue @@ -682,9 +682,18 @@ export default { }, activated() { - this.loadTestCase(); + if (localStorage.getItem('trackProjectChange')) { + // 如果在编辑页切换项目,则跳转到用例列表 + this.$router.push('/track/case/all'); + } else { + this.loadTestCase(); + } }, created(){ + this.$EventBus.$on('projectChange', () => { + this.projectChange = true; + localStorage.setItem('trackProjectChange', 'true'); + }); this.$EventBus.$on("handleSaveCaseWithEvent", this.handleSaveCaseWithEvent); }, methods: { @@ -709,7 +718,7 @@ export default { this.isLastedVersion = isLastedVersion; }, loadTestCase() { - // 校验路径中的 + // 校验路径中的项目ID this.checkCurrentProject(); let initFuc = this.initEdit;