fix: 修复切换项目后路由跳转问题

This commit is contained in:
shiziyuan9527 2020-12-16 14:35:30 +08:00
parent a73b202551
commit 0b38df4576
1 changed files with 4 additions and 7 deletions

View File

@ -98,13 +98,10 @@ export default {
} }
this.$post("/user/update/current", {id: this.userId, lastProjectId: projectId}, () => { this.$post("/user/update/current", {id: this.userId, lastProjectId: projectId}, () => {
localStorage.setItem(PROJECT_ID, projectId); localStorage.setItem(PROJECT_ID, projectId);
if (this.$route.path.indexOf('/track/review/view/') >= 0) { let path = this.$route.matched[0].path ? this.$route.matched[0].path : '/';
this.$router.replace('/track/review/all'); this.$router.push(path).then(() => {
} else if (this.$route.path.indexOf('/track/plan/view/') >= 0) { window.location.reload()
this.$router.replace('/track/plan/all'); }).catch(err => err);
} else {
window.location.reload();
}
this.changeProjectName(projectId); this.changeProjectName(projectId);
}); });
}, },