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
刘传洋
9 years ago
Commit
286943c7d302db6f8d731169fe45e248535c889a
1 parent
5d3857b6
add cache time
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
apps/product/models/search-api.js
apps/product/models/search-api.js
View file @
286943c
...
...
@@ -73,20 +73,20 @@ const getProductList = (params) => {
if
(
cdata
.
filter
&&
cdata
.
standard
)
{
hasCache
=
true
;
finalParams
.
need_filter
=
'no'
;
finalParams
.
need_filter
=
'no'
;
}
}
return
yohoApi
.
get
(
''
,
finalParams
).
then
(
result
=>
{
if
(
hasCache
&&
result
&&
result
.
data
)
{
Object
.
assign
(
result
.
data
,
cdata
);
Object
.
assign
(
result
.
data
,
cdata
);
}
else
{
if
(
result
&&
result
.
data
&&
result
.
data
.
filter
)
{
cache
.
set
(
cKey
,
Object
.
assign
({},
{
filter
:
result
.
data
.
filter
,
standard
:
result
.
data
.
standard
}));
})
,
3600
);
}
}
return
result
;
...
...
@@ -127,7 +127,7 @@ const getSortList = (params) => {
return
yohoApi
.
get
(
''
,
finalParams
).
then
(
ret
=>
{
if
(
ret
&&
ret
.
code
===
200
)
{
cache
.
set
(
cKey
,
ret
);
cache
.
set
(
cKey
,
ret
,
3600
);
}
return
ret
;
});
...
...
@@ -243,10 +243,10 @@ const getBrandShop = (query) => {
return
yohoApi
.
get
(
''
,
finalParams
).
then
(
ret
=>
{
if
(
ret
&&
ret
.
code
===
200
)
{
cache
.
set
(
cKey
,
ret
.
data
);
cache
.
set
(
cKey
,
ret
.
data
,
3600
);
return
ret
.
data
;
}
});
return
});
return
}
});
};
...
...
@@ -280,7 +280,7 @@ const getShopsByBrandId = bid => {
return
yohoApi
.
get
(
''
,
finalParams
).
then
(
ret
=>
{
if
(
ret
&&
ret
.
code
===
200
)
{
cache
.
set
(
cKey
,
ret
.
data
);
cache
.
set
(
cKey
,
ret
.
data
,
3600
);
return
ret
.
data
;
}
});
...
...
Please
register
or
login
to post a comment