fix(router): 修复动态路由加载和错误处理机制

- 将动态路由添加到路由器配置中
- 添加路由获取失败时的错误处理和404页面跳转
- 优化路由加载失败时的日志记录和错误提示
- 修复登出后的重定向路径为登录页面
- 统一错误消息显示格式
This commit is contained in:
2026-06-04 13:25:44 +08:00
parent 0e59b0dbaa
commit 454029edb0
3 changed files with 9 additions and 3 deletions

View File

@@ -456,7 +456,7 @@ export const dynamicRoutes = [
const router = createRouter({
history: createWebHistory(),
routes: constantRoutes,
routes: [...constantRoutes, ...dynamicRoutes],
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition