feat: update menus

This commit is contained in:
Fine 2023-07-11 22:27:04 +08:00
parent f3f0a8e395
commit c3943f317d

View File

@ -25,8 +25,8 @@ import { routesSettings } from "./settings";
const routes: Array<RouteRecordRaw> = [ const routes: Array<RouteRecordRaw> = [
...routesMarketplace, ...routesMarketplace,
...routesLayers, ...routesLayers,
...routesDashboard,
...routesAlarm, ...routesAlarm,
...routesDashboard,
...routesSettings, ...routesSettings,
]; ];
@ -37,8 +37,6 @@ const router = createRouter({
(window as any).axiosCancel = []; (window as any).axiosCancel = [];
const defaultPath = (routesLayers[0] && routesLayers[0].children[0].path) || "";
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// const token = window.localStorage.getItem("skywalking-authority"); // const token = window.localStorage.getItem("skywalking-authority");
if ((window as any).axiosCancel.length !== 0) { if ((window as any).axiosCancel.length !== 0) {
@ -49,6 +47,7 @@ router.beforeEach((to, from, next) => {
} }
if (to.path === "/") { if (to.path === "/") {
const defaultPath = (routesLayers[0] && routesLayers[0].children[0].path) || "";
next({ path: defaultPath }); next({ path: defaultPath });
} else { } else {
next(); next();