A magical react admin
React Admin Template
…基于 umi-plugin-authority 提供权限功能,暴露 useAuthority hooks 和 Authority 组件实现权限控制的能力
使用示例如下
import React from 'react';
import { useAuthority, Authority } from 'umi';
const PageA = props => {
const { foo } = props;
const { combinationVerify } = useAuthority();
// 使用 hooks 提供的能力
if (combinationVerify('module1/action1')) {
// 存在 module1/action1 权限,则...
}
return (
}
>
Foo content.
{/** 直接指定权限 */}
Update foo.
{/** 复杂的校验 */}
Update foo.
{/** children 为function */}
{(isMatch) => 权限校验结果: {isMatch}}
);
};# 克隆项目到本地
git clone [email protected]:ts-react/react-admin-template.git
# 切换到项目目录
cd ./react-admin-template
# 安装依赖
yarn
# 启动服务
npm run start现代浏览器及 IE11。
| IE / Edge | Firefox | Chrome | Safari | Opera |
|---|---|---|---|---|
| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
| Github Issue | 钉钉群 | 微信群 |
|---|---|---|
| issues |
No open issues yet, or sync has not completed.