mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-02-01 11:14:59 +08:00
commit
38360eef12
@ -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 => {
|
||||||
|
//修复路由匹配带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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user