Update index.ts

This commit is contained in:
wangchen147 2025-05-07 14:59:08 +08:00
parent 981fd22caa
commit 8fbb6732d9

View File

@ -79,8 +79,10 @@ router.beforeEach(async (to: any, from, next) => {
// 设置首页路由
let firstRoute: symbol | string | undefined = findFirstValidRoute(userStore.routers)
if (systemStore.apps[0]) {
firstRoute = userStore.addonIndexRoute[ systemStore.apps[0].key ]
if (systemStore.apps && systemStore.apps.length) {
systemStore.apps.forEach(key => {
if (userStore.addonIndexRoute[key]) firstRoute = userStore.addonIndexRoute[key]
})
}
ROOT_ROUTER.redirect = { name: firstRoute }