diff --git a/nuxt.config.js b/nuxt.config.js index 88e9238..6e99010 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -80,7 +80,7 @@ export default { icons: false }, sitemap: { - hostname: 'http://114.132.197.85:8099', + hostname: 'http://www.lighting-it.cn', sitemaps: [ { path: '/sitemap.xml', @@ -89,6 +89,7 @@ export default { '/products.xml', '/inquiry.xml', '/article-page.xml', + '/separate.xml' ], gzip: true }, @@ -99,17 +100,59 @@ export default { { path: '/products.xml', routes: async () => { - const { data: res} = await axios.get('http://114.132.197.85:8099/web/prodPageList?pageNum=1&pageSize=9&catgId=43bb1e22091c0f674453c8db7e89b4a3&tenantId=main') - return res.data.records.map(item => { + const { data: res} = await axios.get('http://114.132.197.85:8099/web/siteMap?catgType=cp&tenantId=main') + return res.data.map(item => { return { - url: `/products/${item.id}`, + url: `/products/${item.id}?catgId=${item.id}&maxCatgId=${item.maxCatgId}`, changefreq: 'daily', priority: 1 } }) }, gzip: true - } + }, + { + path: '/inquiry.xml', + routes: async () => { + const { data: res} = await axios.get('http://114.132.197.85:8099/web/siteMap?catgType=xp&tenantId=main') + return res.data.map(item => { + return { + url: `/inquiry?maxCatgId=${item.maxCatgId}?title=${item.title}`, + changefreq: 'daily', + priority: 1 + } + }) + }, + gzip: true + }, + { + path: '/article-page.xml', + routes: async () => { + const { data: res} = await axios.get('http://114.132.197.85:8099/web/siteMap?catgType=wz&tenantId=main') + return res.data.map(item => { + return { + url: `/article-page/${item.id}?catgId=${item.id}&maxCatgId=${item.maxCatgId}`, + changefreq: 'daily', + priority: 1 + } + }) + }, + gzip: true + }, + { + path: '/inquiry.xml', + routes: async () => { + const { data: res} = await axios.get('http://114.132.197.85:8099/web/siteMap?catgType=dym&tenantId=main') + return res.data.map(item => { + return { + url: `/separate?maxCatgId=${item.maxCatgId}?title=${item.title}`, + changefreq: 'daily', + priority: 1 + } + }) + }, + gzip: true + }, ] }, router: {