This commit is contained in:
张成
2025-10-09 18:17:41 +08:00
parent 366c18bcea
commit ba61c9e45d
63 changed files with 1133 additions and 295 deletions

View File

@@ -72,7 +72,7 @@ class Http {
this.store.commit('user/setToken', '')
}
if (window.rootVue && window.rootVue.$router) {
window.rootVue.$router.push({ name: 'login' })
window.rootVue.$router.push({ path: '/login' }) // 使用 path 而不是 name
}
return Promise.reject(error)
}

View File

@@ -245,11 +245,12 @@ export default class uiTool {
let curRoutes = uiTool.menuToRoute(menus, ParentView, Page404)
// 合并权限路由,保留默认 home 路由
const homeRoute = mainRoute.children.find(r => r.name === 'home')
const hasHome = curRoutes.some(r => r.name === 'home')
const homeRoute = mainRoute.children.find(r => r.path === '/home')
// 检查权限路由中是否有首页(基于 path 判断)
const hasHome = curRoutes.some(r => r.path === '/home' || r.path === 'home')
if (hasHome) {
// 如果权限路由中有 home使用权限路由的 home
// 如果权限路由中有 home使用权限路由的 home(不添加默认首页)
mainRoute.children = curRoutes
} else {
// 如果权限路由中没有 home保留默认 home 并添加其他路由