import React from 'react'; import RenderAuthorized from '@/components/Authorized'; import Exception from '@/components/Exception'; import { matchRoutes } from 'react-router-config'; const Authorized = RenderAuthorized('user'); const noMatch = ; export default ({ children, route, location }) => { const branch = matchRoutes(route.routes, location.pathname).filter(item => item.match.isExact)[0] || {}; const { authority } = branch.route || {}; return ( {children} ); };