material.js 922 Bytes
'use strict';

const api = global.yoho.API;
const serviceApi = global.yoho.ServiceAPI;

const index = (req) => {
    return api.get('/platform/product/material/canlogin', { uid: req.user.uid }).then(data => {
        console.log(data);
        let params = {
            brandId: 1,
            shelveTimeBegin: '2012-02-1 09:53:10',
            shelveTimeEnd: '2017-03-10 09:53:10',
            page: 1
        };

        return api.get('/platform/product/material/getList', Object.assign({
            method: ''
        }, params), { cache: true });
    });
};
const newBrandList = (req) => {
    let channel = req.query.yh_channel || 1;

    return serviceApi.get('', { method: 'app.brand.newBrandList', yh_channel: channel });
};
const getHeaderNavAsync = () => {
    return serviceApi.get('operations/api/v6/category/getCategory', {});
};



module.exports = {
    index,
    newBrandList,
    getHeaderNavAsync
};