import React from 'react'; import { Route, Redirect } from 'react-router-dom'; import Authorized from './Authorized'; class AuthorizedRoute extends React.Component { render() { // TODO: umi只会返回render和rest const { component: Component, render, authority, redirectPath, ...rest } = this.props; return ( } />} > (Component ? : render(props))} /> ); } } export default AuthorizedRoute;