From f07b1d5d115a8780c8cc54ccc987ef05bd2d8d52 Mon Sep 17 00:00:00 2001 From: hejin Date: Mon, 4 Aug 2025 23:38:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=AB=99=E7=82=B9=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E7=9A=84=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nuxt.config.js | 53 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 5 deletions(-) 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: {