初始化 antd-pro
This commit is contained in:
13
admin-web/src/pages/Authorized.js
Normal file
13
admin-web/src/pages/Authorized.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
import RenderAuthorized from '@/components/Authorized';
|
||||
import { getAuthority } from '@/utils/authority';
|
||||
import Redirect from 'umi/redirect';
|
||||
|
||||
const Authority = getAuthority();
|
||||
const Authorized = RenderAuthorized(Authority);
|
||||
|
||||
export default ({ children }) => (
|
||||
<Authorized authority={children.props.route.authority} noMatch={<Redirect to="/user/login" />}>
|
||||
{children}
|
||||
</Authorized>
|
||||
);
|
||||
Reference in New Issue
Block a user