All Projects → alitajs → umi-plugin-authorize

alitajs / umi-plugin-authorize

Licence: MIT license
The permission routing of Umi Convention Router

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Labels

Projects that are alternatives of or similar to umi-plugin-authorize

Alita
一套把React Native代码转换成微信小程序代码的转换引擎工具。我们不造轮子,不发明新框架,只是提供工具把RN扩展到微信小程序端。
Stars: ✭ 1,733 (+8565%)
Mutual labels:  alita
walrus
🎉 Cli development framework.
Stars: ✭ 17 (-15%)
Mutual labels:  alita
rc-charts
一个基于BizCharts的图表库
Stars: ✭ 22 (+10%)
Mutual labels:  alita
autils
Awesome frontend utils library
Stars: ✭ 17 (-15%)
Mutual labels:  alita
umi-plugins
Umi Plugins
Stars: ✭ 14 (-30%)
Mutual labels:  alita

umi-plugin-authorize

NPM version NPM downloads

configure authorize

create by create-umi

Usage

Configure in .umirc.js,

export default {
  plugins: [
    ['umi-plugin-authorize', options],
  ],
}

Options

authorize: [
  {
    guard: ["./routes/PrivateRoute.js"],
    exclude: "scroll-to-top/a"
  },
  {
    guard: ["./routes/PrivateRoute.js"],
    include: /\/list/
  },
  {
    include: "scroll-to-top",
    exclude: "scroll-to-top/a"
  },
  {
    guard: ["./routes/PrivateRoute.js"],
    include: "scroll-to-top",
    exclude: "scroll-to-top/a"
  }
];

authorize必须是一个数组

guard必须是一个数组

include和exclude的值为正则表达式或者字符串

include表示:包含这个字符串或者满足这个正则会被添加

exclude表示:包含这个字符串或者满足这个正则会被忽略

include不存在,则当前设置无效,如上述第一条

exclude不存在,则当前不忽略,如上诉第二条

guard不存在,则当前设置无效,如上述第三条

LICENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].