2.9.0 • Published 2 years ago

umi-plugin-authorize v2.9.0

Weekly downloads
15
License
MIT
Repository
github
Last release
2 years ago

umi-plugin-authorize

NPM version NPM downloads

configure authorize

create by create-umi

Usage

Configure in .umirc.js,

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

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

2.9.0

2 years ago

2.8.37

2 years ago

2.8.35

2 years ago

2.8.12

3 years ago

2.7.9

3 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.4

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.2

6 years ago

0.0.1

6 years ago