...
|
...
|
@@ -6,9 +6,11 @@ |
|
|
'use strict';
|
|
|
|
|
|
const mRoot = '../models';
|
|
|
const library = '../../../library';
|
|
|
const _ = require('lodash');
|
|
|
const headerModel = require('../../../doraemon/models/header');
|
|
|
const starModel = require(`${mRoot}/star`);
|
|
|
const helpers = require(`${library}/helpers`);
|
|
|
|
|
|
const headTab = [
|
|
|
{
|
...
|
...
|
@@ -110,7 +112,7 @@ exports.collocation = (req, res) => { |
|
|
*/
|
|
|
exports.collocationList = (req, res) => {
|
|
|
let params = req.query;
|
|
|
let uid = 9239279 || req.user.uid || 0;
|
|
|
let uid = req.user.uid || 0;
|
|
|
|
|
|
starModel.getCollocationListData(params, uid).then((result) => {
|
|
|
res.render('star/list', _.assign({
|
...
|
...
|
@@ -123,6 +125,26 @@ exports.collocationList = (req, res) => { |
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 收藏文章
|
|
|
* @param {[type]} req [description]
|
|
|
* @param {[type]} res [description]
|
|
|
* @return {[type]}
|
|
|
*/
|
|
|
exports.setFavorite = (req, res) => {
|
|
|
let params = req.body;
|
|
|
let uid = req.user.uid || 0;
|
|
|
|
|
|
starModel.setFavorite(params, uid).then((result) => {
|
|
|
if (result.code === 401) {
|
|
|
result.data = helpers.urlFormat('/signin.html', {
|
|
|
refer: req.get('Referer') || '/guang/star/collocation'
|
|
|
});
|
|
|
}
|
|
|
res.json(result);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 明星文章专区
|
|
|
* @param {[object]} req
|
|
|
* @param {[object]} res
|
...
|
...
|
|