完善退出登录

This commit is contained in:
橙子
2022-04-26 02:13:03 +08:00
parent 3720644153
commit d01c3ff9ca
3 changed files with 49 additions and 46 deletions

View File

@@ -58,9 +58,8 @@ export default {
}); });
}, },
logout() { logout() {
this.$store.dispatch("Logout").then((resp) => { this.$store.dispatch("Logout");
this.$router.push({ path: "/login" }); this.$router.push({ path: "/login" });
});
}, },
}, },
created() { created() {

View File

@@ -1,11 +1,5 @@
<template> <template>
<v-list-group <v-list-group :group="group" :prepend-icon="item.icon" eager v-bind="$attrs">
:group="group"
:prepend-icon="item.icon"
eager
v-bind="$attrs"
>
<template v-slot:activator> <template v-slot:activator>
<v-list-item-icon <v-list-item-icon
v-if="!item.icon && !item.avatar" v-if="!item.icon && !item.avatar"
@@ -41,51 +35,49 @@
</template> </template>
<script> <script>
// Utilities // Utilities
// import { get } from 'vuex-pathify' // import { get } from 'vuex-pathify'
export default { export default {
name: 'DefaultListGroup', name: "DefaultListGroup",
components: { components: {
DefaultListItem: () => import('./ListItem'), DefaultListItem: () => import("./ListItem"),
},
props: {
item: {
type: Object,
default: () => ({}),
}, },
},
props: { computed: {
item: { group() {
type: Object, return this.genGroup(this.item.children);
default: () => ({}),
},
}, },
title() {
computed: { const matches = this.item.menu_name.match(/\b(\w)/g);
if (matches != null) {
group () { return matches.join("");
return this.genGroup(this.item.children) }
},
title () {
const matches = this.item.menu_name.match(/\b(\w)/g)
if(matches!=null)
{
return matches.join('')
}
},
}, },
},
methods: { methods: {
genGroup (items) { genGroup(items) {
return items.reduce((acc, cur) => { return items
if (!cur.router) return acc .reduce((acc, cur) => {
if (!cur.router) return acc;
acc.push( acc.push(
cur.children cur.children ? this.genGroup(cur.children) : cur.router.slice(1, -1)
? this.genGroup(cur.children) );
: cur.router.slice(1, -1),
)
return acc return acc;
}, []).join('|') }, [])
}, .join("|");
}, },
} },
};
</script> </script>

View File

@@ -0,0 +1,12 @@
export function setMenu(menuList) {
if(menuList!=null && menuList.Count()>0)
{
}
}
function setTreeChildren(menuList)
{
}