Ver Fonte

添加代理

Michael Wang há 7 anos atrás
pai
commit
409dd0f04b
1 ficheiros alterados com 52 adições e 0 exclusões
  1. 52 0
      vue.config.js

+ 52 - 0
vue.config.js

@@ -0,0 +1,52 @@
+let proxy = {
+  "/api/ecs_core": {
+    target: " http://ecs-dev.qmth.com.cn:8000", //代理跨域转地址,基础信息
+    changeOrigin: true
+  },
+  "/api/logic/portal": {
+    target: " http://ecs-dev.qmth.com.cn:8018", //
+    changeOrigin: true
+  },
+  "/api/ecs_exam_work": {
+    target: " http://ecs-dev.qmth.com.cn:8001",
+    changeOrigin: true
+  },
+  "/api/ecs_outlet": {
+    target: " http://ecs-dev.qmth.com.cn:8007",
+    changeOrigin: true
+  },
+  "/facepp_api": {
+    target: " http://ecs-dev.qmth.com.cn:8898",
+    changeOrigin: true
+  }
+};
+
+const stu = [
+  "/api/ecs_oe",
+  "/api/online_exam_course",
+  "/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
+  };
+}
+
+module.exports = {
+  devServer: {
+    proxy
+  }
+};