Try to move perstisting to stores

This commit is contained in:
2022-02-10 16:30:42 +00:00
parent 21dcd7837b
commit 0e342f2bcf
3 changed files with 20 additions and 21 deletions

View File

@ -48,6 +48,11 @@ export const useSessionStore = defineStore('session', {
},
logout() {
this.$reset()
},
restoreFromLocalStorage() {
const json = localStorage.getItem("session");
const value = JSON.parse(json || "{}");
Object.assign(this, value);
}
}
})
})