Pre Merge pull request !568 from hecongyuan/master

pull/568/MERGE
hecongyuan 2024-10-27 08:36:47 +00:00 committed by Gitee
commit 0970c5b011
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 1 deletions

View File

@ -98,8 +98,9 @@ export const isServer = typeof window === 'undefined'
export const isClient = !isServer export const isClient = !isServer
export const isUrl = (path: string): boolean => { export const isUrl = (path: string): boolean => {
// fix:修复hash路由无法跳转的问题
const reg = 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) return reg.test(path)
} }