From 4a800a8fc83c6bd1f86a8e847b079a51a7532c09 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期三, 20 七月 2022 15:05:58 +0800
Subject: [PATCH] 修复国标配置的bug

---
 vue.config.js |   63 +++++++++++++++++++++++--------
 1 files changed, 46 insertions(+), 17 deletions(-)

diff --git a/vue.config.js b/vue.config.js
index 29b52cf..103c24f 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,5 +1,6 @@
 "use strict";
 const glob = require("glob");
+const { ExitStatus } = require("typescript");
 const pages = {};
 const IS_VENDOR = /[\\/]node_modules[\\/]/;
 const pageVendor = {};
@@ -8,8 +9,34 @@
 const timestamp = new Date().getTime();
 const queryStr = `?v=${pkg.version}&t=${timestamp}`;
 
+const basicApps = [
+  "index",
+  "ai",
+  "analysisPower",
+  "cameraAccess",
+  "cameraVideo",
+  "datapush",
+  "desktop",
+  "gb28181",
+  "library",
+  "search",
+  "settings",
+  "syslog",
+];
+
+const argv = process.env.npm_lifecycle_event;
+
 glob.sync("./src/pages/**/main.ts").forEach((path) => {
   const chunk = path.split("./src/pages/")[1].split("/main.ts")[0];
+
+  // 浠呯紪璇戝熀纭�搴旂敤
+  if (argv == "release") {
+    let app = chunk.split("/");
+    if (app.length < 0 || basicApps.indexOf(app[0]) < 0) {
+      return;
+    }
+  }
+
   const chunk_vendor = `${chunk}-vendors`;
   const chunk_common = `${chunk}-common`;
   pages[chunk] = {
@@ -40,11 +67,9 @@
   // }
 });
 
-const serverUrl = "http://192.168.20.189:7009"; // 缇婁簲//
-//  const serverUrl = "http://192.168.8.10:7009";
-const serverUrl2 = "http://192.168.8.10:9000";
-// const serverUrl = "http://192.168.20.10:7009";
-// const serverUrl2 = "http://192.168.20.10:9000";
+const serverUrl = "http://192.168.20.189:7009";
+//const serverUrl = "http://192.168.20.116:7009";
+const iotdataServerUrl = "http://192.168.8.10:9000";
 
 // const cir = require("circular-dependency-plugin");
 
@@ -91,14 +116,14 @@
         // ws: true,
         changeOrigin: true,
       },
-      "/data/api-v/app/findAllApp": {
-        // target: '/',
-        target: "http://localhost:8081/",
-        changeOrigin: true,
-        pathRewrite: {
-          "^/data/api-v/app/findAllApp": "apps.json",
-        },
-      },
+      // "/data/api-v/app/findAllApp": {
+      //   // target: '/',
+      //   target: "http://localhost:8080/",
+      //   changeOrigin: true,
+      //   pathRewrite: {
+      //     "^/data/api-v/app/findAllApp": "apps.json",
+      //   },
+      // },
       "/api-c": {
         target: serverUrl,
         changeOrigin: true,
@@ -123,15 +148,19 @@
       },
       "/httpImage": {
         target: serverUrl,
-        changeOrigin: true, //寮�鍚唬鐞�
+        changeOrigin: true, // 鍥剧墖浠g悊
       },
       "/files": {
         target: serverUrl,
-        changeOrigin: true, //寮�鍚唬鐞�
+        changeOrigin: true, // 鏂囦欢浠g悊
       },
       "/iotdata": {
-        target: serverUrl2,
-        changeOrigin: true, //寮�鍚唬鐞�,
+        target: iotdataServerUrl,
+        changeOrigin: true, // iot鏈嶅姟,
+      },
+      "/version": {
+        target: serverUrl,
+        changeOrigin: true, // 鐗堟湰妫�鏌�,
       },
     },
   },

--
Gitblit v1.8.0