resouces.js
888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* 资源位查询
*/
'use strict';
const api = global.yoho.ServiceAPI;
const logger = global.yoho.logger;
const Resources = {
/**
* 获取新品到着-列表页-banner 资源位
* @returns {Promise.<T>}
*/
newProductBanner() {
let params = {
content_code: 'a7989369aa86681c678bc40f171b8f1d'
};
return api.get('/operations/api/v5/resource/get', params).then(result => {
if (result && result.code === 200 && result.data) {
let data = result.data;
if (data.length > 0) {
let d = data[0].data;
return d ? d[0] : {};
}
}
return {};
}).catch(e => {
logger.error('get new product list banner error', e);
return {};
});
}
};
module.exports = Resources;