完善退出登录
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
12
Yi.Vue2.x/src/util/menuHandle.js
Normal file
12
Yi.Vue2.x/src/util/menuHandle.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
export function setMenu(menuList) {
|
||||||
|
if(menuList!=null && menuList.Count()>0)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function setTreeChildren(menuList)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user