vue.config.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. let proxy = {
  2. "/api/ecs_core": {
  3. target: "http://192.168.10.39:8848",
  4. changeOrigin: true
  5. },
  6. "/api/ecs_exam_work": {
  7. target: "http://192.168.10.39:8858",
  8. changeOrigin: true
  9. },
  10. "/api/ecs_ques": {
  11. target: "http://192.168.10.39:8868",
  12. changeOrigin: true
  13. },
  14. "/api/ecs_oe": {
  15. target: "http://192.168.10.39:8878",
  16. changeOrigin: true
  17. },
  18. "/api/ecs_marking": {
  19. target: "http://192.168.10.39:8888",
  20. changeOrigin: true
  21. }
  22. };
  23. // const stu = [
  24. // "/api/ecs_oe",
  25. // "/api/ecs_oe_student/",
  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. // const mock = [{ source: "/api/mock/exam_question", dest: "/examQuestions" }];
  46. // for (const m of mock) {
  47. // proxy[m.source] = {
  48. // target: "http://localhost:3000/",
  49. // changeOrigin: true,
  50. // pathRewrite: {
  51. // ".*": m.dest
  52. // }
  53. // };
  54. // }
  55. var webpack = require("webpack");
  56. module.exports = {
  57. devServer: {
  58. proxy
  59. },
  60. configureWebpack: {
  61. plugins: [
  62. // Ignore all locale files of moment.js
  63. new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
  64. ]
  65. }
  66. };