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}, () => {
localStorage.setItem(PROJECT_ID, projectId);
if (this.$route.path.indexOf('/track/review/view/') >= 0) {
this.$router.replace('/track/review/all');
} else if (this.$route.path.indexOf('/track/plan/view/') >= 0) {
this.$router.replace('/track/plan/all');
} else {
window.location.reload();
}
let path = this.$route.matched[0].path ? this.$route.matched[0].path : '/';
this.$router.push(path).then(() => {
window.location.reload()
}).catch(err => err);
this.changeProjectName(projectId);
});
},