material.js
1.08 KB
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
41
42
43
44
45
46
47
48
49
50
'use strict';
const platformApi = new global.yoho.ApiBase(global.yoho.config.domains.platformApi, {
name: 'imCs',
cache: global.yoho.cache,
useCache: false
});
const api = global.yoho.API;
const canLogin = (uid) => {
return platformApi.get('/platform/product/material/canlogin', {
uid: uid
}).then(result => {
if (result && result.code === 200) {
return result.data.canLogin;
}
});
};
const newBrandList = (req) => {
let channel = req.query.yh_channel || 1;
return api.get('', { method: 'app.brand.newBrandList', yh_channel: channel });
};
const getCategory = () => {
return api.get('', {method: 'web.regular.groupsort'});
};
const getList = (params) => {
return platformApi.get('/platform/product/material/getList', params, {
code: 200
});
};
const getRecommendlist = () => {
return platformApi.get('/platform/product/material/getRecommendlist', {
page: 1
}, {
code: 200
});
};
module.exports = {
canLogin,
newBrandList,
getCategory,
getList,
getRecommendlist
};