Explorar el Código

修改网络代理

Michael Wang hace 6 años
padre
commit
7baef0cd1f
Se han modificado 1 ficheros con 14 adiciones y 43 borrados
  1. 14 43
      vue.config.js

+ 14 - 43
vue.config.js

@@ -1,62 +1,33 @@
-let proxy = {
+const proxy = {
   "/api/ecs_core": {
-    target: "http://192.168.10.39:8848",
+    target: process.env.VUE_APP_CORE_HOST_URL || "http://192.168.10.39:8000",
     changeOrigin: true
   },
   "/api/ecs_exam_work": {
-    target: "http://192.168.10.39:8858",
+    target:
+      process.env.VUE_APP_EXAM_WORK_HOST_URL || "http://192.168.10.39:8001",
     changeOrigin: true
   },
   "/api/ecs_ques": {
-    target: "http://192.168.10.39:8868",
+    target:
+      process.env.VUE_APP_QUESTIONS_HOST_URL || "http://192.168.10.39:8008",
     changeOrigin: true
   },
-  "/api/ecs_oe": {
-    target: "http://192.168.10.39:8878",
+  "/api/ecs_oe_admin": {
+    target: process.env.VUE_APP_OE_HOST_URL || "http://192.168.10.39:8013",
     changeOrigin: true
   },
   "/api/ecs_marking": {
-    target: "http://192.168.10.39:8888",
+    target: process.env.VUE_APP_MARKING_HOST_URL || "http://192.168.10.39:8004",
+    changeOrigin: true
+  },
+  "/api/ecs_data_process": {
+    target:
+      process.env.VUE_APP_DATA_PROCESS_HOST_URL || "http://192.168.10.39:8005",
     changeOrigin: true
   }
 };
 
-// const stu = [
-//   "/api/ecs_oe",
-//   "/api/ecs_oe_student/",
-//   "/api/sys_param",
-//   "/api/exam_record",
-//   "/api/exam_control",
-//   "/api/exam_question",
-//   "/api/exam_score",
-//   "/api/practice_course",
-//   "/api/practice_detail",
-//   "/api/practice_record",
-//   "/api/exam_captures",
-//   "/api/face_capture",
-//   "/api/face_verify",
-//   "/api/offline_exam"
-// ];
-
-// for (const s of stu) {
-//   proxy[s] = {
-//     target: "http://ecs-dev.qmth.com.cn:8003", // 陈恳
-//     changeOrigin: true
-//   };
-// }
-
-// const mock = [{ source: "/api/mock/exam_question", dest: "/examQuestions" }];
-
-// for (const m of mock) {
-//   proxy[m.source] = {
-//     target: "http://localhost:3000/",
-//     changeOrigin: true,
-//     pathRewrite: {
-//       ".*": m.dest
-//     }
-//   };
-// }
-
 var webpack = require("webpack");
 module.exports = {
   devServer: {