Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
htoooth
8 years ago
Commit
ab13441c759ed26b955b0301fb24e958cd76940c
1 parent
3f388d3b
fix query code
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
apps/product/models/search-handler.js
apps/product/models/search-handler.js
View file @
ab13441
...
...
@@ -41,7 +41,8 @@ const handleFilterUrl = (originParam, newParam, delParam) => {
_
.
forEach
(
tempOriginParam
,
function
(
value
,
key
)
{
if
(
!
delParam
[
key
]
&&
value
)
{
dest
+=
`
$
{
key
}
=
$
{
value
}
&
`
;
// NOTE: 这里会对 query 进行编码,因为 query 有可以能是中文
dest
+=
key
===
'query'
?
`
$
{
key
}
=
$
{
encodeURIComponent
(
value
)}
&
`
:
`
$
{
key
}
=
$
{
value
}
&
`
;
}
});
...
...
@@ -1598,6 +1599,11 @@ exports.getSearchParams = params => {
nparams
.
price
=
nmp
.
join
(
','
);
}
// 对可能有中文的情况进行处理
if
(
params
.
query
)
{
params
.
query
=
decodeURIComponent
(
params
.
query
);
}
return
Object
.
assign
({},
params
,
nparams
);
};
...
...
Please
register
or
login
to post a comment