From 3859a48825002da8a1bb6c47b1d35cf0ee53bee3 Mon Sep 17 00:00:00 2001 From: hecongyuan <285121973@qq.com> Date: Mon, 21 Oct 2024 17:10:36 +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 cd2dcc376..24d7191f1 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 => { + // fix:修复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) } -- Gitee