vue.config.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. chainWebpack: config => {
  50. // iview Loader
  51. config.module
  52. .rule("vue")
  53. .test(/\.vue$/)
  54. .use("iview-loader")
  55. .loader("iview-loader")
  56. .options({
  57. prefix: true
  58. })
  59. .end();
  60. }
  61. };