fix(系统设置): 修复切换项目缺陷
This commit is contained in:
parent
4c6523639c
commit
dc8b661616
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue