...
|
...
|
@@ -8,6 +8,7 @@ const staticUrls = require('../../../config/staticUrls'); |
|
|
const api = global.yoho.API;
|
|
|
const Service = global.yoho.ServiceAPI;
|
|
|
const headerModel = require('../../../doraemon/models/header');
|
|
|
const redis = global.yoho.redis;
|
|
|
|
|
|
|
|
|
const getStaticUrls = (currentStatics) => {
|
...
|
...
|
@@ -35,9 +36,30 @@ const getStaticUrls = (currentStatics) => { |
|
|
return Promise.resolve(urls);
|
|
|
};
|
|
|
|
|
|
// 关键词页面
|
|
|
const keywordsPage = () => {
|
|
|
return redis.getAsync('golobal:yoho:seo:keywords:allIds').then(function(res) {
|
|
|
let page = [];
|
|
|
|
|
|
_.forEach(JSON.parse(res), val => {
|
|
|
page.push({
|
|
|
url: `https://www.yohobuy.com/chanpin/${val}.html`,
|
|
|
changefreq: 'daily',
|
|
|
priority: 0.5
|
|
|
});
|
|
|
});
|
|
|
|
|
|
return page;
|
|
|
}).catch(()=>{
|
|
|
return {};
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// www 地图数据
|
|
|
const wwwXmlData = () => {// eslint-disable-line
|
|
|
return getStaticUrls(_.get(staticUrls, 'www'));
|
|
|
return Promise.all([keywordsPage(), getStaticUrls(_.get(staticUrls, 'www'))]).then(result => {
|
|
|
return _.concat(result[1], result[0]);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// list 地图数据
|
...
|
...
|
|