From 0a4a9e0e55ed49e76d8a96d8ae52d48e53e50660 Mon Sep 17 00:00:00 2001 From: hecongyuan <285121973@qq.com> Date: Mon, 21 Oct 2024 17:05:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhash=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=B7=B3=E8=BD=AC=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/is.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/is.ts b/src/utils/is.ts index cd2dcc37..f3dac65a 100644 --- a/src/utils/is.ts +++ b/src/utils/is.ts @@ -98,8 +98,9 @@ export const isServer = typeof window === 'undefined' export const isClient = !isServer export const isUrl = (path: string): boolean => { + //修复路由匹配带hash路由#的地址无法跳转的问题 const reg = - /(((^https?:(?:\/\/)?)(?:[-:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&%@.\w_]*)#?(?:[\w]*))?)$/ + /(((^https?:(?:\/\/)?)(?:[-:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%#\/.\w-_]*)?\??(?:[-\+=&%@.\w_]*)#?(?:[\w]*))?)$/ return reg.test(path) }