| | |
| | | // å
Œ
±è·¯ç±
|
| | | export const constantRoutes = [
|
| | | {
|
| | | path: '/redirect',
|
| | | component: Layout,
|
| | | hidden: true,
|
| | | children: [
|
| | | {
|
| | | path: '/redirect/:path*',
|
| | | component: () => import('@/views/redirect')
|
| | | }
|
| | | ]
|
| | | },
|
| | | {
|
| | | path: '/login',
|
| | | component: () => import('@/views/login'),
|
| | | hidden: true
|
| | |
| | | meta: { title: 'ä¿®æ¹çæé
ç½®' }
|
| | | }
|
| | | ]
|
| | | },
|
| | | { path: '*', redirect: '/404', hidden: true }
|
| | | }
|
| | | ]
|
| | |
|
| | | export default new Router({
|
| | |
| | | // åå端请æ±è·¯ç±æ°æ®
|
| | | getRouters().then(res => {
|
| | | const accessedRoutes = filterAsyncRouter(res.data)
|
| | | accessedRoutes.push({ path: '*', redirect: '/404', hidden: true })
|
| | | commit('SET_ROUTES', accessedRoutes)
|
| | | resolve(accessedRoutes)
|
| | | })
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script> |
| | | export default { |
| | | created() { |
| | | const { params, query } = this.$route |
| | | const { path } = params |
| | | this.$router.replace({ path: '/' + path, query }) |
| | | }, |
| | | render: function(h) { |
| | | return h() // avoid warning message |
| | | } |
| | | } |
| | | </script> |