master
xy 3 years ago
parent 78929be215
commit 2fd0c24d7a

@ -139,6 +139,7 @@ export default {
},
methods: {
async logout() {
await this.$store.dispatch('app/clearLayout')
await this.$store.dispatch("user/logout");
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 {

@ -131,6 +131,14 @@ export default {
async sync() {
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(){
let layout = this.layoutList.map(item => {

Loading…
Cancel
Save