2.1.8 • Published 2 years ago
umi-plugin-extract-auth v2.1.8
umi-plugin-extract-auth
参考文档
Install
# or yarn
$ npm install
$ npm run build --watch
$ npm run start
Usage
Install
pnpm add --D umi-plugin-extract-auth
Configure in .umirc.js
,
export default {
...
extractAuth: {
routerPath: 'config/routes',
appKey: '',
apiPrefix:''
},
...
}
Options
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
routerPath | 路由配置位置 | string | config |
routeFilterRules | 过滤未配置权限页面 | string[] | "exception", "error", "404", "403", "500" |
appKey | 应用 KEY | string | |
apiPrefix | 权限接口前缀 | string | '' |
unifiedAuthorityManage | 是否接入统一权限管理 | boolean | false |
注意
- apiPrefix 字段在 v1.4.0 之后版本有效;
- unifiedAuthorityManage 字段在 v1.5.4 之后版本有效;
自动提取菜单配置
{
// 忽略根据 component 对应文件的自动权限提取
"ignoreComponentPathAuthority": true,
// 该路由不设置权限
"authority": false,
}
LICENSE
MIT