index.js
897 Bytes
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
45
/**
* 逛列表页 controller
* @author: jing.li@yoho.cn<jing.li@yoho.cn>
* @date: 2016/09/05
*/
'use strict';
const headerModel = require('../../../doraemon/models/header'); // 头部model
const indexModel = require('../models/index');
/**
* 逛列表页
* @param req
* @param res
* @param next
*/
exports.index = (req, res, next) => {
let headerData = headerModel.setNav({
navTitle: '逛'
});
let responseData = {
pageHeader: headerData,
module: 'guang',
page: 'index',
title: '逛',
pageFooter: true
};
let param = {
uid: req.user.uid || 6228593,
udid: req.user.udid,
type: req.query.type || 0,
gender: req.query.gender || '1,3'
};
indexModel.getArticle(param).then(result => {
res.render('index', Object.assign(responseData, result));
}).catch(next);
};