fix: 切换工作空间后有其它工作空间的数据
This commit is contained in:
parent
f9326c7b43
commit
8d6a551500
|
@ -67,6 +67,12 @@ export default {
|
|||
}
|
||||
if (localStorage.getItem("store")) {
|
||||
this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(localStorage.getItem("store"))))
|
||||
this.$get("/project/listAll", response => {
|
||||
let projectIds = response.data;
|
||||
if (projectIds && projectIds.length <= 0) {
|
||||
this.$store.commit('setProjectId', undefined);
|
||||
}
|
||||
})
|
||||
}
|
||||
window.addEventListener("beforeunload", () => {
|
||||
localStorage.setItem("store", JSON.stringify(this.$store.state))
|
||||
|
|
Loading…
Reference in New Issue