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
刘传洋
8 years ago
Commit
488d6ab9c85e2b164d18743dccddbc039132af71
1 parent
c8a3ac9d
cache
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
apps/guang/controllers/index.js
apps/guang/models/index.js
apps/guang/controllers/index.js
View file @
488d6ab
...
...
@@ -30,7 +30,7 @@ exports.index = (req, res, next) => {
Promise
.
all
([
guangModel
.
getBanner
(
channel
),
guangModel
.
getCategory
(
type
,
channel
),
guangModel
.
getArticleList
(
gender
,
type
,
uid
,
udid
,
page
,
''
,
''
,
pageSize
,
channel
),
guangModel
.
getArticleList
(
gender
,
type
,
uid
,
udid
,
page
,
''
,
''
,
pageSize
,
channel
,
true
),
guangModel
.
getHotTags
(
page
,
pageSize
,
channel
),
guangModel
.
getAds
(
channel
),
guangModel
.
getRecoArticles
(
gender
,
1
,
10
,
channel
),
...
...
@@ -81,7 +81,7 @@ exports.tags = (req, res, next) => {
Promise
.
all
([
guangModel
.
getBanner
(
channel
),
guangModel
.
getArticleList
(
gender
,
0
,
uid
,
udid
,
page
,
query
,
''
,
pageSize
,
channel
),
guangModel
.
getArticleList
(
gender
,
0
,
uid
,
udid
,
page
,
query
,
''
,
pageSize
,
channel
,
true
),
guangModel
.
getHotTags
(
1
,
20
,
channel
),
guangModel
.
getAds
(
channel
),
guangModel
.
getRecoArticles
(
gender
,
1
,
10
,
channel
),
...
...
@@ -132,7 +132,7 @@ exports.editor = (req, res, next) => {
Promise
.
all
([
guangModel
.
getAuthor
(
authorId
),
guangModel
.
getArticleList
(
gender
,
null
,
uid
,
udid
,
page
,
''
,
authorId
,
pageSize
,
channel
),
guangModel
.
getArticleList
(
gender
,
null
,
uid
,
udid
,
page
,
''
,
authorId
,
pageSize
,
channel
,
true
),
guangModel
.
getHotTags
(
1
,
20
,
channel
),
guangModel
.
getAds
(
channel
),
guangModel
.
getRecoArticles
(
gender
,
1
,
10
,
channel
),
...
...
apps/guang/models/index.js
View file @
488d6ab
...
...
@@ -314,7 +314,7 @@ const getHotTags = (page, limit, channel) => {
};
return
serviceApi
.
get
(
'guang/api/v2/article/getTagTop'
,
data
,
{
cache
:
fals
e
cache
:
tru
e
}).
then
(
res
=>
{
return
_
.
map
((
res
&&
res
.
data
)
||
[],
it
=>
{
let
param
=
{
...
...
@@ -391,7 +391,9 @@ const getBanner = channelType => {
const
getCategory
=
(
currentSortId
,
channel
)
=>
{
currentSortId
=
currentSortId
||
0
;
return
serviceApi
.
get
(
'guang/api/v1/category/get'
,
{}).
then
(
res
=>
{
return
serviceApi
.
get
(
'guang/api/v1/category/get'
,
{},
{
cache
:
true
}).
then
(
res
=>
{
let
list
=
[];
if
(
res
&&
res
.
code
===
200
&&
res
.
data
)
{
...
...
@@ -544,7 +546,7 @@ const getProductList = (params, arr) => {
method
:
'web.search.search'
,
order
:
's_n_desc'
,
limit
:
60
},
params
)).
then
(
ret
=>
{
},
params
)
,
{
cache
:
true
}
).
then
(
ret
=>
{
if
(
ret
&&
ret
.
code
===
200
&&
ret
.
data
&&
ret
.
data
.
product_list
)
{
return
_formatProduct
(
ret
.
data
.
product_list
,
arr
);
}
...
...
Please
register
or
login
to post a comment