index.js
1.06 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
/**
* 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});
});
};