index.js 502 Bytes
'use strict';

const headerModel = require('../../../doraemon/models/header');

const headerNav = (req, res, next) => {
    let channel = req.query.channel || req.yoho.channel;

    headerModel.getHeaderSubNav(channel).then(result => {
        let resData = {code: 400};

        if (result) {
            Object.assign(resData, {
                code: 200,
                data: result
            });
        }

        res.jsonp(resData);
    }).catch(next);
};

module.exports = {
    headerNav
};