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
82cb52a912b5fb4cfbc2833fb25e23b7ef4caad9
1 parent
221d55d8
header cache type
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
doraemon/models/header.js
doraemon/models/header.js
View file @
82cb52a
...
...
@@ -218,12 +218,12 @@ const getHeaderNavAsync = () => {
* @param {String} 频道类型
* @return {promise}
*/
let
cacheHeaderHtml
=
''
;
let
cacheHeaderHtml
=
{}
;
async
function
requestHeaderData
(
type
)
{
let
resData
=
{};
if
(
_
.
isEmpty
(
cacheHeaderHtml
))
{
if
(
_
.
isEmpty
(
cacheHeaderHtml
[
type
]
))
{
let
channelNum
=
(
function
()
{
switch
(
type
)
{
case
'boys'
:
...
...
@@ -267,10 +267,10 @@ async function requestHeaderData(type) {
resData
=
template
(
resData
);
if
(
res
[
0
]
&&
res
[
0
].
data
&&
res
[
1
]
&&
res
[
1
].
data
)
{
cacheHeaderHtml
=
resData
;
cacheHeaderHtml
[
type
]
=
resData
;
}
}
else
{
resData
=
cacheHeaderHtml
;
resData
=
cacheHeaderHtml
[
type
]
;
}
return
Promise
.
resolve
({
headerData
:
resData
});
...
...
@@ -278,7 +278,7 @@ async function requestHeaderData(type) {
setInterval
(
function
()
{
cacheHeaderHtml
=
''
;
cacheHeaderHtml
=
{}
;
},
60
*
10
*
1000
);
module
.
exports
=
{
...
...
Please
register
or
login
to post a comment