logout
This commit is contained in:
parent
a51d75894b
commit
f0de7a195c
1 changed files with 9 additions and 0 deletions
|
|
@ -18,6 +18,10 @@ watch(() => route.meta, (newVal, oldVal) => {
|
||||||
const toggle = (event) => {
|
const toggle = (event) => {
|
||||||
menu.value.toggle(event);
|
menu.value.toggle(event);
|
||||||
};
|
};
|
||||||
|
const logout = () => {
|
||||||
|
userStore.logout();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const menu = ref();
|
const menu = ref();
|
||||||
const localActions = [{
|
const localActions = [{
|
||||||
|
|
@ -30,6 +34,11 @@ const localActions = [{
|
||||||
needsAuth: true,
|
needsAuth: true,
|
||||||
}];
|
}];
|
||||||
const allActions = [...userActions, ...localActions];
|
const allActions = [...userActions, ...localActions];
|
||||||
|
allActions.map((item) => {
|
||||||
|
if (item.cmd === 'logout') {
|
||||||
|
item.command = logout;
|
||||||
|
}
|
||||||
|
});
|
||||||
const items = ref(allActions);
|
const items = ref(allActions);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue