|
|
@@ -1,7 +1,10 @@
|
|
|
import * as path from "path";
|
|
|
import axios from "axios";
|
|
|
-import {handleAll} from "./until/handle";
|
|
|
+import {handleAll, handle} from "./until/handle";
|
|
|
import {apiMap} from "./map/apiMap";
|
|
|
+import d_news from "./server/database/d_news";
|
|
|
+import d_product from "./server/database/d_product";
|
|
|
+
|
|
|
const devPort = 3000;
|
|
|
const serverPort = 4201;
|
|
|
|
|
|
@@ -15,6 +18,37 @@ const env = {
|
|
|
ENV_API: `http://szhfy.com.cn:${serverPort}` // 正式服务器地址
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+async function loadProductTypes(baseUrl){
|
|
|
+ let productTypes = [];
|
|
|
+ let [err, res] = await handle(d_product.loadTypes())
|
|
|
+ if(err){
|
|
|
+ console.log(err);
|
|
|
+ }
|
|
|
+ // typekey
|
|
|
+ res.forEach(item=>{
|
|
|
+ productTypes.push(`${baseUrl}/${item.typeKey}`)
|
|
|
+ });
|
|
|
+ return productTypes;
|
|
|
+}
|
|
|
+async function loadNewsTypes(solutionUrl, newsUrl){
|
|
|
+ let pages = [];
|
|
|
+ let [err, res] = await handle(d_news.loadTypes())
|
|
|
+ if(err){
|
|
|
+ console.log(err);
|
|
|
+ }
|
|
|
+ // typekey
|
|
|
+ res.forEach(item=>{
|
|
|
+ if(item.parent_type == 1){
|
|
|
+ pages.push(`${solutionUrl}/${item.typeKey}`)
|
|
|
+ }else{
|
|
|
+ pages.push(`${newsUrl}/${item.typeKey}`)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return pages;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
function loadSvgConfig(config, ctx) {
|
|
|
// 排除 nuxt 原配置的影响,Nuxt 默认有vue-loader,会处理svg,img等
|
|
|
// 找到匹配.svg的规则,然后将存放svg文件的目录排除
|
|
|
@@ -142,8 +176,8 @@ export default {
|
|
|
head: {
|
|
|
title: '深圳市合方圆科技',
|
|
|
meta: [
|
|
|
- { charset: 'utf-8' },
|
|
|
- { name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
|
|
+ { charset: 'utf-8' },
|
|
|
+ { name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
|
|
{ hid: 'keywords', name: 'keywords', content: '合方圆,深圳合方圆,深圳合方圆科技,合方圆科技,4G低功耗'},
|
|
|
{ hid: 'description', name: 'description', content: '网站描述' },
|
|
|
],
|