mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-02 17:44:46 +00:00
fix: set default route (#354)
This commit is contained in:
parent
001fa25a3b
commit
c5d80d96fb
@ -47,7 +47,23 @@ router.beforeEach((to, from, next) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (to.path === "/") {
|
if (to.path === "/") {
|
||||||
const defaultPath = (routesLayers[0] && routesLayers[0].children[0].path) || "";
|
let defaultPath = "";
|
||||||
|
for (const route of routesLayers) {
|
||||||
|
for (const child of route.children) {
|
||||||
|
if (child.meta.activate) {
|
||||||
|
defaultPath = child.path;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (defaultPath) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!defaultPath) {
|
||||||
|
defaultPath = "/marketplace";
|
||||||
|
}
|
||||||
|
|
||||||
next({ path: defaultPath });
|
next({ path: defaultPath });
|
||||||
} else {
|
} else {
|
||||||
next();
|
next();
|
||||||
|
Loading…
Reference in New Issue
Block a user