@@ -21,8 +21,9 @@ const Layout = () => import('../views/layout/Layout')
2121 icon: 'svg-name' the icon show in the sidebar,
2222 }
2323 **/
24- export const constantRouterMap = [
25- // { path: '/', redirect: '/index', hidden: true },
24+
25+ // 基础路由
26+ const routeBase = [
2627 { path : '/' , name : 'index' , component : ( ) => import ( '@/views/home/index' ) , hidden : true } ,
2728 { path : '/line' , name : 'line' , component : ( ) => import ( '@/views/home/line' ) , hidden : true } ,
2829 { path : '/home' , component : ( ) => import ( '@/views/home/home' ) , hidden : true } ,
@@ -42,8 +43,11 @@ export const constantRouterMap = [
4243 path : 'dashboard' ,
4344 component : ( ) => import ( '@/views/dashboard/index' )
4445 } ]
45- } ,
46+ }
47+ ]
4648
49+ // 管理一般路由
50+ const routeManage = [
4751 {
4852 path : '/api_excel' ,
4953 component : Layout ,
@@ -73,7 +77,11 @@ export const constantRouterMap = [
7377 meta : { title : '接口列表' , icon : 'api' }
7478 }
7579 ]
76- } ,
80+ }
81+ ]
82+
83+ const routerAdmin = [
84+ // { path: '/', redirect: '/index', hidden: true },
7785
7886 {
7987 path : '/category' ,
@@ -207,8 +215,11 @@ export const constantRouterMap = [
207215 meta : { title : '角色管理' , icon : 'role' }
208216 }
209217 ]
210- } ,
218+ }
211219
220+ ]
221+
222+ const routeOther = [
212223 {
213224 path : '/form' ,
214225 component : Layout ,
@@ -221,7 +232,6 @@ export const constantRouterMap = [
221232 }
222233 ] , hidden : true
223234 } ,
224-
225235 {
226236 path : '/nested' ,
227237 component : Layout ,
@@ -282,6 +292,8 @@ export const constantRouterMap = [
282292 { path : '*' , redirect : '/404' , hidden : true }
283293]
284294
295+ export const constantRouterMap = [ ...routeBase , ...routeManage , ...routerAdmin , ...routeOther ]
296+
285297export default new Router ( {
286298 // mode: 'history', //后端支持可开
287299 scrollBehavior : ( ) => ( { y : 0 } ) ,
0 commit comments