فهرست منبع

打包兼容新旧domain

Michael Wang 5 سال پیش
والد
کامیت
9a387ac70e
6فایلهای تغییر یافته به همراه16 افزوده شده و 1 حذف شده
  1. 1 0
      .env.development
  2. 1 0
      .env.production
  3. 9 0
      .env.production-temp
  4. 1 0
      .env.stagingAli
  5. 3 0
      package.json
  6. 1 1
      vue.config.js

+ 1 - 0
.env.development

@@ -13,6 +13,7 @@ VUE_APP_TK_SERVER_API_URL=http://ecs-test.qmth.com.cn
 VUE_APP_CORE_HOST_URL=https://ecs-test.qmth.com.cn:8878
 VUE_APP_OE_ADMIN_HOST_URL=https://ecs-test.qmth.com.cn:8878
 VUE_APP_OE_STUDENT_HOST_URL=https://ecs-test.qmth.com.cn:8878
+VUE_APP_PUBLIC_PATH=/oe/
 VUE_APP_SLS_STORE_NAME=student-client-test
 
 # VUE_APP_CONFIG_FILE_SEVER_URL=https://ecs-test-static.qmth.com.cn

+ 1 - 0
.env.production

@@ -2,6 +2,7 @@ VUE_APP_CONFIG_FILE_SEVER_URL=https://ecs-static.qmth.com.cn
 # 考虑直接用location.host,即以下两个变量不需要
 VUE_APP_TK_SERVER_HTML_URL=http://ecs.qmth.com.cn
 VUE_APP_TK_SERVER_API_URL=http://ecs.qmth.com.cn
+VUE_APP_PUBLIC_PATH=/oe/
 VUE_APP_SLS_STORE_NAME=student-client
 #VUE_APP_WK_SERVER_SOCKET=wss://ecs.qmth.com.cn:8878/api/ws/faceBiopsy
 #VUE_APP_WK_SERVER_SOCKET_FOR_AUDIO=wss://ecs.qmth.com.cn:8878/api/ws/fileAnswer

+ 9 - 0
.env.production-temp

@@ -0,0 +1,9 @@
+VUE_APP_CONFIG_FILE_SEVER_URL=https://ecs-static.qmth.com.cn
+# 考虑直接用location.host,即以下两个变量不需要
+VUE_APP_TK_SERVER_HTML_URL=http://ecs.qmth.com.cn
+VUE_APP_TK_SERVER_API_URL=http://ecs.qmth.com.cn
+VUE_APP_PUBLIC_PATH=/oe-web/
+VUE_APP_SLS_STORE_NAME=student-client
+#VUE_APP_WK_SERVER_SOCKET=wss://ecs.qmth.com.cn:8878/api/ws/faceBiopsy
+#VUE_APP_WK_SERVER_SOCKET_FOR_AUDIO=wss://ecs.qmth.com.cn:8878/api/ws/fileAnswer
+VUE_APP_GIT_REPO_VERSION=TO_BE_OVERRIDED

+ 1 - 0
.env.stagingAli

@@ -3,6 +3,7 @@ VUE_APP_CONFIG_FILE_SEVER_URL=https://ecs-test-static.qmth.com.cn
 VUE_APP_TK_SERVER_HTML_URL=http://ecs-test.qmth.com.cn
 VUE_APP_TK_SERVER_API_URL=http://ecs-test.qmth.com.cn
 VUE_APP_SLS_STORE_NAME=student-client-test
+VUE_APP_PUBLIC_PATH=/oe/
 #VUE_APP_WK_SERVER_SOCKET=wss://ecs-test.qmth.com.cn:8878/api/ws/faceBiopsy
 #VUE_APP_WK_SERVER_SOCKET_FOR_AUDIO=wss://ecs-test.qmth.com.cn:8878/api/ws/fileAnswer
 VUE_APP_GIT_REPO_VERSION=TO_BE_OVERRIDED

+ 3 - 0
package.json

@@ -20,6 +20,9 @@
     "prebuild:stagingAli": "node prebuild",
     "build:stagingAli": "NODE_ENV=production vue-cli-service build --mode stagingAli",
     "postbuild:stagingAli": "node postbuild",
+    "prebuild:prod-temp": "node prebuild",
+    "build:prod-temp": "NODE_ENV=production vue-cli-service build --mode production-temp",
+    "postbuild:prod-temp": "IS_PROD=true node postbuild",
     "prebuild:prod": "node prebuild",
     "build:prod": "vue-cli-service build",
     "postbuild:prod": "IS_PROD=true node postbuild",

+ 1 - 1
vue.config.js

@@ -62,7 +62,7 @@ var webpack = require("webpack");
 
 module.exports = {
   lintOnSave: process.env.NODE_ENV !== "production" ? true : "error",
-  publicPath: "/oe-web/",
+  publicPath: process.env.VUE_APP_PUBLIC_PATH,
   devServer: {
     proxy,
   },