proxy.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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.0.14:52015/',
  15. // 配置了这个可以从 http 代理到 https
  16. // 依赖 origin 的功能可能需要这个,比如 cookie
  17. changeOrigin: true,
  18. pathRewrite: { '^/api': '' },
  19. },
  20. '/api2/': {
  21. // 要代理的地址
  22. target: 'http://192.168.0.14:52010/',
  23. // 配置了这个可以从 http 代理到 https
  24. // 依赖 origin 的功能可能需要这个,比如 cookie
  25. changeOrigin: true,
  26. pathRewrite: { '^/api2': '' },
  27. },
  28. '/api3/': {
  29. // 要代理的地址
  30. //target: 'http://api.sagacloud.cn/',
  31. target: 'http://192.168.0.65:52015/',
  32. // 配置了这个可以从 http 代理到 https
  33. // 依赖 origin 的功能可能需要这个,比如 cookie
  34. changeOrigin: true,
  35. pathRewrite: { '^/api3': '' },
  36. },
  37. },
  38. test: {
  39. '/api/': {
  40. target: 'http://192.168.0.14:52015/',
  41. changeOrigin: true,
  42. pathRewrite: { '^/api': '' },
  43. },
  44. },
  45. pre: {
  46. '/api/': {
  47. target: 'your pre url',
  48. changeOrigin: true,
  49. pathRewrite: { '^/api': '' },
  50. },
  51. },
  52. };