动态菜单和动态路由的 antd pro

Authorized.js 376B

12345678910111213
  1. import React from 'react';
  2. import CheckPermissions from './CheckPermissions';
  3. class Authorized extends React.Component {
  4. render() {
  5. const { children, authority, noMatch = null } = this.props;
  6. const childrenRender = typeof children === 'undefined' ? null : children;
  7. return CheckPermissions(authority, childrenRender, noMatch);
  8. }
  9. }
  10. export default Authorized;