Browse Source

fix(utils): 外链菜单权限判断报错 (#6625)

pull/6677/head
zacks 6 years ago
committed by GitHub
parent
commit
bb040b1946
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/utils/utils.ts

4
src/utils/utils.ts

@ -35,8 +35,8 @@ export const getAuthorityFromRouter = <T extends Route>(
pathname: string,
): T | undefined => {
const authority = router.find(
({ routes, path = '/' }) =>
(path && pathRegexp(path).exec(pathname)) ||
({ routes, path = '/', target = '_self' }) =>
(path && target !== '_blank' && pathRegexp(path).exec(pathname)) ||
(routes && getAuthorityFromRouter(routes, pathname)),
);
if (authority) return authority;

Loading…
Cancel
Save