Merge pull request #6 from valarchie/revert-5-main

Revert "Fix: Ensure route.children existence before accessing in initRouter() and Fix serverConfig.json fetching behavior across nested routes"
This commit is contained in:
valarchie 2024-02-20 17:04:20 +08:00 committed by GitHub
commit afcc1651cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 7 deletions

View File

@ -31,7 +31,7 @@ export const getServerConfig = async (app: App): Promise<undefined> => {
app.config.globalProperties.$config = getConfig(); app.config.globalProperties.$config = getConfig();
return axios({ return axios({
method: "get", method: "get",
url: `${window.location.origin}/serverConfig.json` url: `${VITE_PUBLIC_PATH}serverConfig.json`
}) })
.then(({ data: config }) => { .then(({ data: config }) => {
let $config = app.config.globalProperties.$config; let $config = app.config.globalProperties.$config;

View File

@ -158,12 +158,7 @@ router.beforeEach((to: ToRouteType, _from, next) => {
getTopMenu(true); getTopMenu(true);
// query、params模式路由传参数的标签页不在此处处理 // query、params模式路由传参数的标签页不在此处处理
if (route && route.meta?.title) { if (route && route.meta?.title) {
if ( if (isAllEmpty(route.parentId) && route.meta?.backstage) {
isAllEmpty(route.parentId) &&
route.meta?.backstage &&
route.children &&
route.children.length > 0
) {
// 此处为动态顶级路由(目录) // 此处为动态顶级路由(目录)
const { path, name, meta } = route.children[0]; const { path, name, meta } = route.children[0];
useMultiTagsStoreHook().handleTags("push", { useMultiTagsStoreHook().handleTags("push", {