Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
38360eef
authored
Oct 27, 2024
by
芋道源码
Committed by
GitHub
Oct 27, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #95 from hecongyuan/master
修复hash路由无法跳转的问题
parents
5ef5ee6e
0a4a9e0e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletions
+2
-1
src/utils/is.ts
+2
-1
No files found.
src/utils/is.ts
View file @
38360eef
...
...
@@ -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
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment