Просмотр исходного кода

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

zacks 5 лет назад
Родитель
Сommit
bb040b1946
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/utils/utils.ts

+ 2 - 2
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;