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

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

Loading…
Cancel
Save