完善退出登录

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() {
this.$store.dispatch("Logout").then((resp) => {
this.$router.push({ path: "/login" });
});
this.$store.dispatch("Logout");
this.$router.push({ path: "/login" });
},
},
created() {

View File

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

View File

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