- 添加菜单权限控制
- url 权限控制
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user