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