Browse Source

Fixing Inheritability of Permissions (#5347)

https://github.com/ant-design/ant-design-pro/issues/4883
pull/5366/head
拷钉 7 years ago
committed by 陈帅
parent
commit
21e1794335
  1. 3
      src/pages/Authorized.tsx

3
src/pages/Authorized.tsx

@ -12,6 +12,9 @@ interface AuthComponentProps extends ConnectProps {
const getRouteAuthority = (path: string, routeData: Route[]) => {
let authorities: string[] | string | undefined;
routeData.forEach(route => {
if (route.authority) {
authorities = route.authority;
}
// match prefix
if (pathToRegexp(`${route.path}(.*)`).test(path)) {
// exact match

Loading…
Cancel
Save