正在显示
3 个修改的文件
包含
25 行增加
和
2 行删除
| @@ -27,6 +27,17 @@ import Layout from '@/layout' | @@ -27,6 +27,17 @@ import Layout from '@/layout' | ||
| 27 | // 公共路由 | 27 | // 公共路由 |
| 28 | export const constantRoutes = [ | 28 | export const constantRoutes = [ |
| 29 | { | 29 | { |
| 30 | + path: '/redirect', | ||
| 31 | + component: Layout, | ||
| 32 | + hidden: true, | ||
| 33 | + children: [ | ||
| 34 | + { | ||
| 35 | + path: '/redirect/:path*', | ||
| 36 | + component: () => import('@/views/redirect') | ||
| 37 | + } | ||
| 38 | + ] | ||
| 39 | + }, | ||
| 40 | + { | ||
| 30 | path: '/login', | 41 | path: '/login', |
| 31 | component: () => import('@/views/login'), | 42 | component: () => import('@/views/login'), |
| 32 | hidden: true | 43 | hidden: true |
| @@ -93,8 +104,7 @@ export const constantRoutes = [ | @@ -93,8 +104,7 @@ export const constantRoutes = [ | ||
| 93 | meta: { title: '修改生成配置' } | 104 | meta: { title: '修改生成配置' } |
| 94 | } | 105 | } |
| 95 | ] | 106 | ] |
| 96 | - }, | ||
| 97 | - { path: '*', redirect: '/404', hidden: true } | 107 | + } |
| 98 | ] | 108 | ] |
| 99 | 109 | ||
| 100 | export default new Router({ | 110 | export default new Router({ |
| @@ -20,6 +20,7 @@ const permission = { | @@ -20,6 +20,7 @@ const permission = { | ||
| 20 | // 向后端请求路由数据 | 20 | // 向后端请求路由数据 |
| 21 | getRouters().then(res => { | 21 | getRouters().then(res => { |
| 22 | const accessedRoutes = filterAsyncRouter(res.data) | 22 | const accessedRoutes = filterAsyncRouter(res.data) |
| 23 | + accessedRoutes.push({ path: '*', redirect: '/404', hidden: true }) | ||
| 23 | commit('SET_ROUTES', accessedRoutes) | 24 | commit('SET_ROUTES', accessedRoutes) |
| 24 | resolve(accessedRoutes) | 25 | resolve(accessedRoutes) |
| 25 | }) | 26 | }) |
ruoyi-ui/src/views/redirect.vue
0 → 100644
-
请 注册 或 登录 后发表评论