index.js
594 Bytes
/**
* index controller
* @author: 赵彪<bill.zhao@yoho.cn>
* @date: 2016/05/03
*/
'use strict';
const headerModel = require('../../../doraemon/models/header');
exports.index = (req, res) => {
headerModel.requestHeaderData()
.then(response => {
let data = headerModel.setHeaderData(response.data, 'boys');
data.module = 'index';
data.page = 'index';
data.footerTop = true;
res.render('index', data);
})
.catch(() => {
res.render('index', {devEnv: true, pageErr: true});
});
};