Authored by 郝肖肖

Merge branch 'hotfix/goodsXml'

'use strict';
const moment = require('moment');
const SeoIndexModel = require('../../models/seo/index');
const index = (req, res) => {
... ... @@ -50,8 +52,9 @@ const demoXml = (req, res) => {
const siteMapXml = (req, res) => {
req.ctx(SeoIndexModel).getGoodsPage().then(result => {
let date = moment(new Date()).format('YYYY-MM-DD');
let sitemap = new Array(result).fill().map((val, k) => {
return `http://spiderwebhook.yoho.cn/dist/goods-xml/goods-${k + 1}.xml`;
return {url: `http://spiderwebhook.yoho.cn/dist/goods-xml/goods-${k + 1}.xml`, date: date};
});
res.setHeader('Content-Type', 'text/xml; charset=utf-8');
... ...
... ... @@ -3346,6 +3346,69 @@ const baiduBrand = {
categoryLv2: '女装',
categoryLv3: '羊毛衫',
categoryLv4: '羊毛衫'
},
1906: {
yoho: '针织衫',
categoryLv1: '服饰内衣',
categoryLv2: '女装',
categoryLv3: '针织衫',
categoryLv4: '针织衫'
},
416: {
yoho: '冷帽',
categoryLv1: '服饰内衣',
categoryLv2: '服饰配件',
categoryLv3: '围巾/手套/帽子套装',
categoryLv4: '帽子'
},
418: {
yoho: '套装',
categoryLv1: '美妆个护',
categoryLv2: '洗发护发',
categoryLv3: '套装',
categoryLv4: '套装'
},
422: {
yoho: '围巾',
categoryLv1: '服饰内衣',
categoryLv2: '服饰配件',
categoryLv3: '围巾/手套/帽子套装',
categoryLv4: '围巾'
},
424: {
yoho: '棉衣',
categoryLv1: '运动户外',
categoryLv2: '运动服饰',
categoryLv3: '棉服',
categoryLv4: '棉服'
},
432: {
yoho: '羽绒服',
categoryLv1: '运动户外',
categoryLv2: '户外鞋服',
categoryLv3: '羽绒服/棉服',
categoryLv4: '羽绒服'
},
435: {
yoho: '手套',
categoryLv1: '服饰内衣',
categoryLv2: '服饰配件',
categoryLv3: '围巾/手套/帽子套装',
categoryLv4: '手套'
},
449: {
yoho: '儿童玩具',
categoryLv1: '玩具乐器',
categoryLv2: '娃娃玩具',
categoryLv3: '芭比娃娃',
categoryLv4: '芭比娃娃'
},
454: {
yoho: '防风外套',
categoryLv1: '服饰内衣',
categoryLv2: '女装',
categoryLv3: '短外套',
categoryLv4: '短外套'
}
};
... ...
... ... @@ -165,7 +165,7 @@ class SeoIndexModel extends global.yoho.BaseModel {
}
autoGoodsXml(params) {
return util.sleep(60000).then(() => {
return util.sleep(2000).then(() => {
return this.writerGoodsXml(params);
}).then(rdata => {
... ...
... ... @@ -2,9 +2,8 @@
<sitemapindex>
{{#sitemap}}
<sitemap>
<loc>
{{.}}
</loc>
<loc>{{url}}</loc>
<lastmod>{{date}}</lastmod>
</sitemap>
{{/sitemap}}
</sitemapindex>
... ...