From bb040b1946bff874a539abe02ddff077404454df Mon Sep 17 00:00:00 2001 From: zacks Date: Wed, 20 May 2020 15:10:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(utils):=20=E5=A4=96=E9=93=BE=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=9D=83=E9=99=90=E5=88=A4=E6=96=AD=E6=8A=A5=E9=94=99?= =?UTF-8?q?=20(#6625)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/utils.ts b/src/utils/utils.ts index e0afc31e..1f43882c 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -35,8 +35,8 @@ export const getAuthorityFromRouter = ( 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;