fix(系统设置): 修复切换项目缺陷

This commit is contained in:
shiziyuan9527 2020-12-18 15:01:43 +08:00
parent 4c6523639c
commit dc8b661616
1 changed files with 9 additions and 0 deletions

View File

@ -101,6 +101,15 @@ export default {
this.$post("/user/update/current", {id: this.userId, lastProjectId: projectId}, () => {
localStorage.setItem(PROJECT_ID, projectId);
let path = this.$route.matched[0].path ? this.$route.matched[0].path : '/';
if (path === '/api') {
if (this.$store.state.switch.value === 'new') {
path = "/api/home";
} else if (this.$store.state.switch.value === 'old') {
path = "/api/home_obsolete";
} else {
path = '/';
}
}
this.$router.push(path).then(() => {
window.location.reload()
}).catch(err => err);