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
yyq
7 years ago
Commit
a654070d0ccb044bbdcf8db05db50ea5441d2ce9
1 parent
0bf966a6
query key
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
apps/product/controllers/search.js
apps/product/controllers/search.js
View file @
a654070
...
...
@@ -26,17 +26,20 @@ const index = (req, res, next) => {
let
params
=
req
.
query
;
let
resData
=
{};
req
.
ctx
(
search
).
getKeyActivity
(
params
.
query
).
then
(
activityUrl
=>
{
let
queryKey
=
params
.
query
;
queryKey
&&
(
queryKey
=
queryKey
.
replace
(
/
(
<|>
)
/g
,
''
));
req
.
ctx
(
search
).
getKeyActivity
(
queryKey
).
then
(
activityUrl
=>
{
if
(
activityUrl
)
{
activityUrl
=
encodeURI
(
activityUrl
);
res
.
redirect
(
activityUrl
);
return
;
}
return
req
.
ctx
(
search
).
getSearchDataPre
(
Object
.
assign
(
params
,
{
uid
:
req
.
user
.
uid
,
prid
:
req
.
user
.
prid
}),
return
req
.
ctx
(
search
).
getSearchDataPre
(
Object
.
assign
(
params
,
{
uid
:
req
.
user
.
uid
,
prid
:
req
.
user
.
prid
,
query
:
queryKey
}),
req
.
yoho
.
channel
).
then
(
result
=>
{
let
queryKey
=
req
.
query
.
query
;
Object
.
assign
(
resData
,
result
);
if
(
!
_
.
get
(
resData
,
'search.goods'
)
||
!
_
.
get
(
resData
,
'search.goods'
).
length
)
{
...
...
Please
register
or
login
to post a comment