index.js
723 Bytes
/**
* 个人中心二维码 controller
* @author: chengyao.guo<chengyao.guo@yoho.cn>
* @date: 2016/08/10
*/
'use strict';
const headerModel = require('../../../doraemon/models/header'); // 头部model
const indexModel = require('../models/index');
exports.index = (req, res, next) => {
let params = {
uid: req.user.uid || '6228593'
};
let headerData = headerModel.setNav({
navTitle: '个人中心'
});
indexModel.index(params).then(result => {
result.isLogin = true;
if (result) {
res.render('index', Object.assign(result, {
pageHeader: headerData,
pageFooter: true
}));
}
}).catch(next);
};