diff --git a/src/config/index.ts b/src/config/index.ts index ce6e994..d5402ae 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -30,6 +30,7 @@ const getConfig = (key?: string): ServerConfigs => { export const getServerConfig = async (app: App): Promise => { app.config.globalProperties.$config = getConfig(); return axios({ + method: "get", url: `${configConver()}serverConfig.json` }) .then(({ data: config }) => { diff --git a/src/router/index.ts b/src/router/index.ts index 8565cd2..9df7082 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -158,7 +158,12 @@ router.beforeEach((to: ToRouteType, _from, next) => { getTopMenu(true); // query、params模式路由传参数的标签页不在此处处理 if (route && route.meta?.title) { - if (isAllEmpty(route.parentId) && route.meta?.backstage) { + if ( + isAllEmpty(route.parentId) && + route.meta?.backstage && + route.children && + route.children.length > 0 + ) { // 此处为动态顶级路由(目录) const { path, name, meta } = route.children[0]; useMultiTagsStoreHook().handleTags("push", {