|
|
|
@ -81,9 +81,6 @@ router.beforeEach(async (to, from, next) => {
|
|
|
|
|
// await store.dispatch('auth/getPermission');
|
|
|
|
|
// }
|
|
|
|
|
if (to.matched.length) {
|
|
|
|
|
store.commit('layout/setActiveAside', to.matched.find((item) => !item.meta?.layout).name);
|
|
|
|
|
store.commit('layout/setActiveMenu', to.name);
|
|
|
|
|
store.commit('layout/setActiveTab', to.name);
|
|
|
|
|
console.info(`[router] from ${from.name} to ${to.name}`);
|
|
|
|
|
if (to.meta.global) {
|
|
|
|
|
next();
|
|
|
|
@ -97,6 +94,10 @@ router.beforeEach(async (to, from, next) => {
|
|
|
|
|
next({ name: childName });
|
|
|
|
|
} else {
|
|
|
|
|
next();
|
|
|
|
|
store.commit('layout/setActiveAside', to.matched.find((item) => !item.meta?.layout).name);
|
|
|
|
|
store.commit('layout/setActiveMenu', to.name);
|
|
|
|
|
store.commit('layout/setActiveTab', to.name);
|
|
|
|
|
store.commit('layout/setBreakcrumbList', to.matched);
|
|
|
|
|
store.commit('layout/addTab', to);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|