BlankLayout.jsx 506 Bytes
Newer Older
1
import check from '@/components/Authorized/CheckPermissions';
dengxiaofeng's avatar
dengxiaofeng committed
2
import React from 'react';
3
import { renderRoutes } from 'react-router-config';
张烨's avatar
张烨 committed
4
import page403 from '@/pages/exception/403';
5 6 7 8
const Layout = ({ children, route }) => (
  <>
    {children ||
      renderRoutes(
张烨's avatar
张烨 committed
9 10 11 12 13 14 15
        route.routes.map(r => {
          if (!r.authority) {
            return r;
          }
          r.component = check(r.authority, r.component, page403);
          return r;
        }),
16 17 18
      )}
  </>
);
dengxiaofeng's avatar
dengxiaofeng committed
19 20

export default Layout;