Authored by 郝肖肖

'url'

... ... @@ -31,7 +31,7 @@ app.set('views', path.join(__dirname, 'apps/views'));
app.set('view engine', 'hbs');
// 设置public文件夹为存放静态文件的目录
app.use('/dist', express.static(path.join(__dirname, './public/dist/')));
app.use('/goods-xml', express.static(path.join(__dirname, './public/dist/goods-xml/')));
// 添加请求上下文
app.use(global.yoho.httpCtx());
... ... @@ -40,7 +40,7 @@ app.get('/goods-:start.xml', cseo.index);
app.get('/auto-goods.html', cseo.autoGoodsXml);
app.get('/seo/setTask', cseo.setTask);
app.get('/seo/delTask', cseo.delTask);
app.get('/seo/sitemap.xml', cseo.siteMapXml);
app.get('/goods/sitemap.xml', cseo.siteMapXml);
app.get('/demo.xml', cseo.demoXml);
app.get('/demo.xsd', cseo.demoXsd);
... ...
... ... @@ -59,7 +59,7 @@ 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 {url: `https://www.yohobuy.com/format-data/goods-xml/goods-${k + 1}.xml`, date: date};
return {url: `https://www.yohobuy.com/xml-data/goods-xml/goods-${k + 1}.xml`, date: date};
});
res.setHeader('Content-Type', 'text/xml; charset=utf-8');
... ...