import routes from './routes' ; import { routeItem , routesInfoMap } from '@/store/types' ; const routesArr = routes ( ) ; const parseRoutesToMap = ( routesArr , routesInfoMap ) => { routesArr . filter ( ( item ) => ! item . public || item . mutiTab ) . forEach ( route => { if ( route . children && route . children . length > 0 ) { parseRoutesToMap ( route . children , routesInfoMap ) ; } else { routesInfoMap [ route . id ] = { module : route . module , public : route . public || false } ; } } ) ; } ; export default ( ) => { const routesInfoMap = { } ; parseRoutesToMap ( routesArr [ 1 ] . children as routeItem [ ] , routesInfoMap ) ; return routesInfoMap ; } ;