Authored by 郝肖肖

'url'

@@ -31,7 +31,7 @@ app.set('views', path.join(__dirname, 'apps/views')); @@ -31,7 +31,7 @@ app.set('views', path.join(__dirname, 'apps/views'));
31 app.set('view engine', 'hbs'); 31 app.set('view engine', 'hbs');
32 32
33 // 设置public文件夹为存放静态文件的目录 33 // 设置public文件夹为存放静态文件的目录
34 -app.use('/dist', express.static(path.join(__dirname, './public/dist/'))); 34 +app.use('/goods-xml', express.static(path.join(__dirname, './public/dist/goods-xml/')));
35 35
36 // 添加请求上下文 36 // 添加请求上下文
37 app.use(global.yoho.httpCtx()); 37 app.use(global.yoho.httpCtx());
@@ -40,7 +40,7 @@ app.get('/goods-:start.xml', cseo.index); @@ -40,7 +40,7 @@ app.get('/goods-:start.xml', cseo.index);
40 app.get('/auto-goods.html', cseo.autoGoodsXml); 40 app.get('/auto-goods.html', cseo.autoGoodsXml);
41 app.get('/seo/setTask', cseo.setTask); 41 app.get('/seo/setTask', cseo.setTask);
42 app.get('/seo/delTask', cseo.delTask); 42 app.get('/seo/delTask', cseo.delTask);
43 -app.get('/seo/sitemap.xml', cseo.siteMapXml); 43 +app.get('/goods/sitemap.xml', cseo.siteMapXml);
44 app.get('/demo.xml', cseo.demoXml); 44 app.get('/demo.xml', cseo.demoXml);
45 app.get('/demo.xsd', cseo.demoXsd); 45 app.get('/demo.xsd', cseo.demoXsd);
46 46
@@ -59,7 +59,7 @@ const siteMapXml = (req, res) => { @@ -59,7 +59,7 @@ const siteMapXml = (req, res) => {
59 req.ctx(SeoIndexModel).getGoodsPage().then(result => { 59 req.ctx(SeoIndexModel).getGoodsPage().then(result => {
60 let date = moment(new Date()).format('YYYY-MM-DD'); 60 let date = moment(new Date()).format('YYYY-MM-DD');
61 let sitemap = new Array(result).fill().map((val, k) => { 61 let sitemap = new Array(result).fill().map((val, k) => {
62 - return {url: `https://www.yohobuy.com/format-data/goods-xml/goods-${k + 1}.xml`, date: date}; 62 + return {url: `https://www.yohobuy.com/xml-data/goods-xml/goods-${k + 1}.xml`, date: date};
63 }); 63 });
64 64
65 res.setHeader('Content-Type', 'text/xml; charset=utf-8'); 65 res.setHeader('Content-Type', 'text/xml; charset=utf-8');