master
xy 3 years ago
parent 78929be215
commit 2fd0c24d7a

@ -139,6 +139,7 @@ export default {
}, },
methods: { methods: {
async logout() { async logout() {
await this.$store.dispatch('app/clearLayout')
await this.$store.dispatch("user/logout"); await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`); this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}, },

@ -82,6 +82,10 @@ const actions = {
}); });
}); });
}, },
clearLayout({ commit }) {
commit("SET_LAYOUT",{})
window.localStorage.removeItem('worker-layout')
}
}; };
export default { export default {

@ -131,6 +131,14 @@ export default {
async sync() { async sync() {
await this.$store.dispatch("app/setLayout") await this.$store.dispatch("app/setLayout")
this.$store.dispatch('app/getLayout').then(res => {
this.layoutList = res.map(item => {
layout.forEach(lay => {
lay.i === item.i ? item.component = lay.component : ''
})
return item
})
})
}, },
save(){ save(){
let layout = this.layoutList.map(item => { let layout = this.layoutList.map(item => {

Loading…
Cancel
Save