- 添加菜单权限控制

- url 权限控制
This commit is contained in:
sin
2019-03-04 11:32:26 +08:00
parent 17e1a017c9
commit 8a804d654e
5 changed files with 41 additions and 29 deletions

View File

@@ -4,10 +4,16 @@ import { getAuthority } from '@/utils/authority';
import Redirect from 'umi/redirect';
const Authority = getAuthority();
// TODO RenderAuthorized 暂时写死为 admin次组件集成于 antd-pro 后期有时间处理,(可能有用,可能没用)
// TODO 可大致分为两种角色admin 管理员角色user 代表其他非授权页面,可以公开的
// const Authorized = RenderAuthorized(['admin', 'user']);
const Authorized = RenderAuthorized(Authority);
export default ({ children }) => (
<Authorized authority={children.props.route.authority} noMatch={<Redirect to="/user/login" />}>
{children}
</Authorized>
);
export default ({ children }) => {
return (
<Authorized authority={children.props.route.authority} noMatch={<Redirect to="/user/login" />}>
{children}
</Authorized>
);
};