proxy.ts 1.8 KB

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