proxy.js 1017B

12345678910111213141516171819202122232425262728293031323334353637383940
  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://invoice-filling.stategrid.njyunzhi.com',
  15. changeOrigin: true,
  16. headers: {
  17. origin: 'http://invoice-filling.stategrid.njyunzhi.com',
  18. referer: 'http://invoice-filling.stategrid.njyunzhi.com',
  19. },
  20. },
  21. },
  22. test: {
  23. '/api/': {
  24. target: 'https://proapi.azurewebsites.net',
  25. changeOrigin: true,
  26. pathRewrite: {
  27. '^': '',
  28. },
  29. },
  30. },
  31. pre: {
  32. '/api/': {
  33. target: 'your pre url',
  34. changeOrigin: true,
  35. pathRewrite: {
  36. '^': '',
  37. },
  38. },
  39. },
  40. };