|
|
@@ -15,7 +15,7 @@ const env = {
|
|
|
},
|
|
|
pro: {
|
|
|
MODE: 'production',
|
|
|
- ENV_API: `http://szhfy.com.cn:${serverPort}` // 正式服务器地址
|
|
|
+ ENV_API: `http://127.0.0.1:${serverPort}` // 正式服务器地址
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -100,48 +100,58 @@ async function seoDataLoad(){
|
|
|
newsData = newsRes.data;
|
|
|
if(productData.code === 1){
|
|
|
let productArr = productData.data;
|
|
|
+ let productTypes = {}
|
|
|
+
|
|
|
productArr.forEach(item=>{
|
|
|
+ productTypes[item.type_key] = item.type_key
|
|
|
routes.push(
|
|
|
{
|
|
|
- url: `/product/info?id=${item.id}`,
|
|
|
+ url: `/product/info/${item.type_key}?id=${item.id}`,
|
|
|
changefreq: 'daily',
|
|
|
- priority: 0.9,
|
|
|
- },
|
|
|
+ priority: 0.8,
|
|
|
+ }
|
|
|
+ );
|
|
|
+ })
|
|
|
+ for (let type_key in productTypes) {
|
|
|
+ routes.push(
|
|
|
{
|
|
|
- url: `/product/info/${item.type_key}?id=${item.id}`,
|
|
|
+ url: `/product/${type_key}`,
|
|
|
changefreq: 'daily',
|
|
|
priority: 0.9,
|
|
|
}
|
|
|
);
|
|
|
- })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
if(solutionData.code === 1){
|
|
|
let solutionArr = solutionData.data;
|
|
|
+ let solutionTypes = {}
|
|
|
solutionArr.forEach(item=>{
|
|
|
+ solutionTypes[item.type_key] = item.type_key
|
|
|
routes.push(
|
|
|
- {
|
|
|
- url: `/solution/info?id=${item.id}`,
|
|
|
- changefreq: 'daily',
|
|
|
- priority: 0.8,
|
|
|
- },
|
|
|
{
|
|
|
url: `/solution/info/${item.type_key}?id=${item.id}`,
|
|
|
changefreq: 'daily',
|
|
|
priority: 0.8,
|
|
|
}
|
|
|
);
|
|
|
-
|
|
|
})
|
|
|
+ for (let type_key in solutionTypes) {
|
|
|
+ routes.push(
|
|
|
+ {
|
|
|
+ url: `/solution/${type_key}`,
|
|
|
+ changefreq: 'daily',
|
|
|
+ priority: 0.9,
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
if(newsData.code === 1){
|
|
|
let newsArr = newsData.data;
|
|
|
+ let newsTypes = {}
|
|
|
newsArr.forEach(item=>{
|
|
|
+ newsTypes[item.type_key] = item.type_key
|
|
|
routes.push(
|
|
|
- {
|
|
|
- url: `/news/info?id=${item.id}`,
|
|
|
- changefreq: 'daily',
|
|
|
- priority: 0.7,
|
|
|
- },
|
|
|
{
|
|
|
url: `/news/info/${item.type_key}?id=${item.id}`,
|
|
|
changefreq: 'daily',
|
|
|
@@ -149,6 +159,15 @@ async function seoDataLoad(){
|
|
|
}
|
|
|
);
|
|
|
})
|
|
|
+ for (let type_key in newsTypes) {
|
|
|
+ routes.push(
|
|
|
+ {
|
|
|
+ url: `/news/${type_key}`,
|
|
|
+ changefreq: 'daily',
|
|
|
+ priority: 0.9,
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
console.log(routes);
|
|
|
@@ -213,12 +232,15 @@ export default {
|
|
|
],
|
|
|
sitemap: [
|
|
|
{
|
|
|
- path: "/sitemap.xml", //生成的文件路径
|
|
|
- ...seoOption,
|
|
|
- routes: seoDataLoad,
|
|
|
- },
|
|
|
- {
|
|
|
- path: "/sitemap.html", //生成的文件路径
|
|
|
+ hostname: "hofuniot.cn",
|
|
|
+ path: '/sitemap.xml',
|
|
|
+ exclude:[
|
|
|
+ "/news/info",
|
|
|
+ "/solution/info",
|
|
|
+ "/product/info"
|
|
|
+ ],
|
|
|
+ cacheTime: 1000 * 60 * 60 * 24,
|
|
|
+ gzip: true,
|
|
|
...seoOption,
|
|
|
routes: seoDataLoad,
|
|
|
}
|