vue.config.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. let proxy = {
  2. "/api/ecs_core": {
  3. target: " http://ecs-dev.qmth.com.cn:8000", //代理跨域转地址,基础信息
  4. changeOrigin: true
  5. },
  6. "/api/logic/portal": {
  7. target: " http://ecs-dev.qmth.com.cn:8018", //
  8. changeOrigin: true
  9. },
  10. "/api/ecs_exam_work": {
  11. target: " http://ecs-dev.qmth.com.cn:8001",
  12. changeOrigin: true
  13. },
  14. "/api/ecs_outlet": {
  15. target: " http://ecs-dev.qmth.com.cn:8007",
  16. changeOrigin: true
  17. },
  18. "/facepp_api": {
  19. target: " http://ecs-dev.qmth.com.cn:8898",
  20. changeOrigin: true
  21. }
  22. };
  23. const stu = [
  24. "/api/ecs_oe",
  25. "/api/online_exam_course",
  26. "/api/sys_param",
  27. "/api/exam_record",
  28. "/api/exam_control",
  29. "/api/exam_question",
  30. "/api/exam_score",
  31. "/api/practice_course",
  32. "/api/practice_detail",
  33. "/api/practice_record",
  34. "/api/exam_captures",
  35. "/api/face_capture",
  36. "/api/face_verify",
  37. "/api/offline_exam"
  38. ];
  39. for (const s of stu) {
  40. proxy[s] = {
  41. target: " http://ecs-dev.qmth.com.cn:8003",
  42. changeOrigin: true
  43. };
  44. }
  45. module.exports = {
  46. devServer: {
  47. proxy
  48. }
  49. };