proxy.js 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
  3. * -------------------------------
  4. * The agent cannot take effect in the production environment
  5. * so there is no configuration of the production environment
  6. * For details, please see
  7. * https://pro.ant.design/docs/deploy
  8. */
  9. export default {
  10. dev: {
  11. // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
  12. '/api/': {
  13. // 要代理的地址
  14. target: 'http://192.168.89.25:9002',
  15. changeOrigin: true,
  16. headers: {
  17. origin: 'http://192.168.89.25:9002',
  18. referer: 'http://192.168.89.25:9002',
  19. },
  20. // target: 'https://pet-certificate-online.njyunzhi.com',
  21. // // 配置了这个可以从 http 代理到 https
  22. // // 依赖 origin 的功能可能需要这个,比如 cookie
  23. // changeOrigin: true,
  24. // headers: {
  25. // origin: 'https://pet-certificate-online.njyunzhi.com',
  26. // referer: 'https://pet-certificate-online.njyunzhi.com',
  27. // },
  28. },
  29. },
  30. test: {
  31. '/api/': {
  32. target: 'https://proapi.azurewebsites.net',
  33. changeOrigin: true,
  34. pathRewrite: {
  35. '^': '',
  36. },
  37. },
  38. },
  39. pre: {
  40. '/api/': {
  41. target: 'your pre url',
  42. changeOrigin: true,
  43. pathRewrite: {
  44. '^': '',
  45. },
  46. },
  47. },
  48. };