1.0.0
黄崇栋 5 years ago
parent f7e0c3fc4d
commit 37a58efeca

@ -51,20 +51,15 @@ export default {
setRoute() { setRoute() {
let parents = []; let parents = [];
if (this.userInfo.id) { if (this.userInfo.id) {
parents = this.$router.options.routes[0].children.filter( parents = this.$router.options.routes[0].children.filter(ele => {
ele => {
if ( if (
this.userInfo.permissionList.some(item => { this.userInfo.permissionList.some(item => {
return ( return item.rights === ele.name && ele.name.indexOf("center") < 0;
item.rights === ele.name &&
ele.name.indexOf("personal") < 0
);
}) })
) { ) {
return ele; return ele;
} }
} });
);
// // // //
let recursionRoute = parents => { let recursionRoute = parents => {
for (let i = 0; i < parents.length; i++) { for (let i = 0; i < parents.length; i++) {
@ -79,11 +74,9 @@ export default {
}; };
recursionRoute(parents); recursionRoute(parents);
} else { } else {
parents = this.$router.options.routes[0].children.filter( parents = this.$router.options.routes[0].children.filter(item => {
item => {
return !item.name.startsWith("center"); return !item.name.startsWith("center");
} });
);
} }
this.routes = parents; this.routes = parents;
@ -96,9 +89,7 @@ export default {
if (this.$route.matched.length > 3) { if (this.$route.matched.length > 3) {
this.selectedKeys = [this.$route.matched[2].name]; this.selectedKeys = [this.$route.matched[2].name];
} else { } else {
this.selectedKeys = [ this.selectedKeys = [this.$route.matched[this.$route.matched.length - 1].name];
this.$route.matched[this.$route.matched.length - 1].name
];
} }
} else { } else {
this.selectedKeys = [this.$route.matched[1].name]; this.selectedKeys = [this.$route.matched[1].name];

Loading…
Cancel
Save