index.js 1.06 KB
/**
 * girls controller
 * @author: 赵彪<bill.zhao@yoho.cn>
 * @date: 2016/05/16
 */

'use strict';

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

// const channelModel = require('../models/index');

exports.boysIndex = (req, res) => {
    headerModel.requestHeaderData()
        .then(response => {
            let data = headerModel.setHeaderData(response.data, 'boys');

            data.module = 'index';
            data.page = 'index';
            data.footerTop = true;

            res.render('boys', data);
        })
        .catch(() => {
            res.render('error', {devEnv: true, pageErr: true});
        });
};

exports.girlsIndex = (req, res) => {
    headerModel.requestHeaderData()
        .then(response => {
            let data = headerModel.setHeaderData(response.data, 'girls');

            data.module = 'index';
            data.page = 'index';
            data.footerTop = true;

            res.render('girls', data);
        })
        .catch(() => {
            res.render('error', {devEnv: true, pageErr: true});
        });

};