Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
xyxBooking-weapp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2026-01-20 11:12:26 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6f2b20936bab2b06ef417ec0527b7825916c951d
6f2b2093
1 parent
6d51bb0a
fix(请求参数): 修复URL查询参数解析问题
使用手动解析替代URLSearchParams以正确处理特殊字符
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
src/utils/request.js
src/utils/request.js
View file @
6f2b209
...
...
@@ -73,9 +73,19 @@ const merge_request_params = (config) => {
const
base_url
=
parts
[
0
]
const
search
=
parts
.
slice
(
1
).
join
(
'?'
)
const
url_params
=
{}
const
search_params
=
new
URLSearchParams
(
search
)
for
(
const
[
key
,
value
]
of
search_params
.
entries
())
{
url_params
[
key
]
=
value
if
(
search
)
{
const
pairs
=
search
.
split
(
'&'
)
for
(
let
i
=
0
;
i
<
pairs
.
length
;
i
++
)
{
const
pair
=
pairs
[
i
]
if
(
!
pair
)
continue
const
index
=
pair
.
indexOf
(
'='
)
const
raw_key
=
index
>=
0
?
pair
.
slice
(
0
,
index
)
:
pair
const
raw_value
=
index
>=
0
?
pair
.
slice
(
index
+
1
)
:
''
const
key
=
decodeURIComponent
(
raw_key
||
''
)
const
value
=
decodeURIComponent
(
raw_value
||
''
)
if
(
!
key
)
continue
url_params
[
key
]
=
value
}
}
const
merged_params
=
{
...
REQUEST_DEFAULT_PARAMS
,
...
...
Please
register
or
login
to post a comment