Authored by 毕凯

Merge branch 'feature/docker' of git.yoho.cn:fe/yohobuywap-node into feature/docker

@@ -33,10 +33,9 @@ const index = (req, res, next) => { @@ -33,10 +33,9 @@ const index = (req, res, next) => {
33 }); 33 });
34 34
35 _.forEach(result, item => { 35 _.forEach(result, item => {
36 - item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://' + item.url;  
37 feed.addItem({ 36 feed.addItem({
38 title: item.title, 37 title: item.title,
39 - link: `${item.url}&ref=rss`, 38 + link: `https://m.yohobuy.com/guang/${item.id}.html?ref=rss`,
40 description: item.intro, 39 description: item.intro,
41 author: [{ 40 author: [{
42 name: (item.author && item.author.name) || ' ' 41 name: (item.author && item.author.name) || ' '
@@ -60,7 +59,7 @@ const rss = (req, res, next, gmt) => { @@ -60,7 +59,7 @@ const rss = (req, res, next, gmt) => {
60 return next(); 59 return next();
61 } 60 }
62 _.forEach(result, item => { 61 _.forEach(result, item => {
63 - item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://' + item.url; 62 + item.url = `https://m.yohobuy.com/guang/${item.id}.html?ref=rss`;
64 let time = new Date(item.publishTimeLong && 63 let time = new Date(item.publishTimeLong &&
65 parseFloat(item.publishTimeLong) || moment(item.publishTime, 'MM月DD日 HH:mm')); 64 parseFloat(item.publishTimeLong) || moment(item.publishTime, 'MM月DD日 HH:mm'));
66 let format = gmt ? 'ddd, MM MMM YYYY hh:mm:ss +0800' : 'YYYY-MM-DD hh:mm:ss +0800'; 65 let format = gmt ? 'ddd, MM MMM YYYY hh:mm:ss +0800' : 'YYYY-MM-DD hh:mm:ss +0800';
@@ -33,16 +33,16 @@ class RssModel extends global.yoho.BaseModel { @@ -33,16 +33,16 @@ class RssModel extends global.yoho.BaseModel {
33 if (value.text) { // 文字 33 if (value.text) { // 文字
34 result += htmlProcess.removeHtml(htmlProcess.escapeToHtml(value.text.data.text)) + '<br/>'; 34 result += htmlProcess.removeHtml(htmlProcess.escapeToHtml(value.text.data.text)) + '<br/>';
35 } else if (value.singleImage) { // 单张图 35 } else if (value.singleImage) { // 单张图
36 - result += `<img src="${helpers.image(value.singleImage.data[0].src, 640, 640)}"/><br/>`; 36 + result += `<img src="https:${helpers.image(value.singleImage.data[0].src, 640, 640)}"/><br/>`;
37 } else if (value.smallPic && value.smallPic.data) { // 多张小图 37 } else if (value.smallPic && value.smallPic.data) { // 多张小图
38 value.smallPic.data.forEach((small) => { 38 value.smallPic.data.forEach((small) => {
39 - result += `<img src="${helpers.image(small.src, 315, 420)}"/>`; 39 + result += `<img src="https:${helpers.image(small.src, 315, 420)}"/>`;
40 }); 40 });
41 result += '<br/>'; 41 result += '<br/>';
42 } 42 }
43 }); 43 });
44 44
45 - result += `<a href="http://guang.m.yohobuy.com/info/index?id=${id}">查看原文</a>`; 45 + result += `<a href="https://m.yohobuy.com/guang/${id}.html?ref=rss">查看原文</a>`;
46 return result; 46 return result;
47 } 47 }
48 }); 48 });
1 <?xml version='1.0' encoding='utf-8'?> 1 <?xml version='1.0' encoding='utf-8'?>
2 <rss version='2.0'> 2 <rss version='2.0'>
3 <channel> 3 <channel>
4 - <language>zh-cn</language> 4 + <language>zh-cn</language>
5 <title><![CDATA[有货逛]]></title> 5 <title><![CDATA[有货逛]]></title>
6 <link><![CDATA[http://yohobuy.com]]></link> 6 <link><![CDATA[http://yohobuy.com]]></link>
7 <description><![CDATA[Yoho!Buy有货 | 年轻人潮流购物中心]]></description> 7 <description><![CDATA[Yoho!Buy有货 | 年轻人潮流购物中心]]></description>
@@ -17,13 +17,13 @@ @@ -17,13 +17,13 @@
17 {{# items}} 17 {{# items}}
18 <item> 18 <item>
19 <title><![CDATA[{{title}}]]></title> 19 <title><![CDATA[{{title}}]]></title>
20 - <link><![CDATA[{{{url}}}&ref=rss]]></link> 20 + <link><![CDATA[{{{url}}}]]></link>
21 <description><![CDATA[{{{intro}}}]]></description> 21 <description><![CDATA[{{{intro}}}]]></description>
22 <pubDate><![CDATA[{{publishTime}}]]></pubDate> 22 <pubDate><![CDATA[{{publishTime}}]]></pubDate>
23 <source><![CDATA[有货逛]]></source> 23 <source><![CDATA[有货逛]]></source>
24 <author>有货</author> 24 <author>有货</author>
25 </item> 25 </item>
26 {{/items}} 26 {{/items}}
27 - 27 +
28 </channel> 28 </channel>
29 -</rss>  
  29 +</rss>