custom.js 826 Bytes
/**
 * 自定义频道, 临时方案,暂时写死
 */
'use strict';
const customModel = require('../models/custom');

let index = (req, res, next) => {
    let contentCode = req.params.id;

    if (!contentCode) {
        return next();
    }

    customModel.getResourceData(contentCode).then(result => {
        res.render('custom', {
            module: 'channel',
            page: 'custom',
            content: result,
            title: req.query.title || 'Yoho!Buy 有货'
        });
    }).catch(next);
};

let zhihui = (req, res) => {
    res.render('zhihui', {
        module: 'channel',
        page: 'custom',
        title: req.query.title || 'Yoho!Buy 有货',
        downloadLink: 'http://union.yoho.cn/union/downapp.html?union_type=100000000000081'
    });
};

module.exports = {
    index,
    zhihui
};