...
|
...
|
@@ -4,7 +4,9 @@ const _ = require('lodash'); |
|
|
const helpers = global.yoho.helpers;
|
|
|
const headerModel = require('../../../doraemon/models/header');
|
|
|
const NewsAPi = require('./news-api');
|
|
|
const utils = require('./utils');
|
|
|
const moment = require('moment');
|
|
|
const xss = require('xss');
|
|
|
const searchHandler = require('../../product/models/search-handler');
|
|
|
|
|
|
console.log(global.utils);
|
...
|
...
|
@@ -121,6 +123,7 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
let newsAPi = new NewsAPi(this.ctx);
|
|
|
let params = {
|
|
|
type: 'wechat',
|
|
|
atype: param.atype || 'yohogroup',
|
|
|
limit: 20,
|
|
|
page: param.page || 1
|
|
|
};
|
...
|
...
|
@@ -132,7 +135,7 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
content_code: ADS_CODE[channel] || ADS_CODE.boys,
|
|
|
isAdDegrade: _.get(this.ctx, 'req.app.locals.pc.guang.removeAd', false)
|
|
|
}),
|
|
|
newsAPi.getPolymerizationList(params),
|
|
|
newsAPi.getPolymerizationList(Object.assign({}, params, {id: param.atype || 'yohogroup'})),
|
|
|
];
|
|
|
|
|
|
return Promise.all(apiMethod).then(result => {
|
...
|
...
|
@@ -163,8 +166,13 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
title: contents.title,
|
|
|
time: contents.update_time && moment(contents.update_time * 1000).format('YYYY年MM月DD HH:mm'),
|
|
|
};
|
|
|
let content = utils.filterPhtml(contents.content, [
|
|
|
'阅读原文',
|
|
|
'点击这里',
|
|
|
'点这里'
|
|
|
]);
|
|
|
|
|
|
return {header: header, content: contents.content};
|
|
|
return {header: header, content: xss(utils.filterAhtml(content))};
|
|
|
}
|
|
|
|
|
|
detail(channel, param) {
|
...
|
...
|
|