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
80dc2b55d14c07029b37e5b05129dd97638e9250
1 parent
2e3397a5
add cache
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
apps/passport/models/index-api.js
apps/product/models/detail-product-api.js
config/common.js
apps/passport/models/index-api.js
View file @
80dc2b5
...
...
@@ -6,13 +6,15 @@
const
serviceAPI
=
global
.
yoho
.
ServiceAPI
;
const
config
=
global
.
yoho
.
config
;
/**
* 资源码找资源
*/
const
getResourceAsync
=
resourceCode
=>
{
return
serviceAPI
.
get
(
'/operations/api/v5/resource/get'
,
{
content_code
:
resourceCode
});
}
,
config
.
apiCache
);
};
module
.
exports
=
{
...
...
apps/product/models/detail-product-api.js
View file @
80dc2b5
...
...
@@ -5,12 +5,13 @@
'use strict'
;
const
api
=
global
.
yoho
.
API
;
const
config
=
global
.
yoho
.
config
;
const
getProductBannerAsync
=
(
pid
)
=>
{
return
api
.
get
(
''
,
{
method
:
'web.productBanner.data'
,
product_id
:
pid
});
}
,
config
.
apiCache
);
};
...
...
@@ -18,7 +19,7 @@ const sizeInfoAsync = skn => {
return
api
.
get
(
''
,
{
method
:
'h5.product.intro'
,
productskn
:
skn
});
}
,
config
.
apiCache
);
};
...
...
@@ -27,14 +28,14 @@ const isSupportReturnedSale = skn => {
return
api
.
get
(
''
,
{
method
:
'app.product.refundExchange'
,
product_skn
:
skn
});
}
,
config
.
apiCache
);
};
const
getProductComfortAsync
=
pid
=>
{
return
api
.
get
(
''
,
{
method
:
'web.productComfort.data'
,
product_id
:
pid
});
}
,
config
.
apiCache
);
};
...
...
@@ -42,14 +43,14 @@ const getProductModelCardAsync = pid => {
return
api
.
get
(
''
,
{
method
:
'web.productModelcard.list'
,
product_id
:
pid
});
}
,
config
.
apiCache
);
};
const
getProductModelTryAsync
=
skn
=>
{
return
api
.
get
(
''
,
{
method
:
'web.productModelTry.data'
,
product_skn
:
skn
});
}
,
config
.
apiCache
);
};
/**
...
...
@@ -74,7 +75,7 @@ const getProductAsync = (pid, uid, isStudents, vipLevel) => {
if
(
vipLevel
)
{
params
.
current_vip_level
=
vipLevel
;
}
return
api
.
get
(
''
,
params
);
return
api
.
get
(
''
,
params
,
config
.
apiCache
);
};
const
getPromotionAsync
=
(
skn
)
=>
{
...
...
@@ -83,7 +84,7 @@ const getPromotionAsync = (skn) => {
product_skn
:
skn
};
return
api
.
get
(
''
,
params
);
return
api
.
get
(
''
,
params
,
config
.
apiCache
);
};
const
getLimitedProductStatusAsync
=
(
code
,
uid
,
skn
)
=>
{
...
...
@@ -100,7 +101,7 @@ const getLimitedProductStatusAsync = (code, uid, skn) => {
params
.
product_skn
=
skn
;
}
return
api
.
get
(
''
,
params
);
return
api
.
get
(
''
,
params
,
config
.
apiCache
);
};
module
.
exports
=
{
...
...
config/common.js
View file @
80dc2b5
...
...
@@ -72,6 +72,9 @@ module.exports = {
appID
:
'wx3ae21dcbb82ad672'
,
appSecret
:
'e78afb2321e6a19085767e1a0f0d52c1'
}
},
apiCache
:
{
cache
:
true
}
};
...
...
Please
register
or
login
to post a comment