proxy.ts 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. '/duoduo-service': {
  37. target: 'https://duoduoenv.sagacloud.cn/',
  38. // target: 'http://192.168.12.13:52011/',
  39. changeOrigin: true,
  40. pathRewrite: {
  41. // "^/apis": ""
  42. },
  43. },
  44. // '/api3/': {
  45. // // 要代理的地址
  46. // //target: 'http://api.sagacloud.cn/',
  47. // target: 'http://192.168.0.65:52015/',
  48. // // 配置了这个可以从 http 代理到 https
  49. // // 依赖 origin 的功能可能需要这个,比如 cookie
  50. // changeOrigin: true,
  51. // pathRewrite: { '^/api3': '' },
  52. // },
  53. '/api4/': {
  54. // 要代理的地址
  55. //target: 'http://api.sagacloud.cn/',
  56. target: 'http://api.sagacloud.cn/',
  57. // 配置了这个可以从 http 代理到 https
  58. // 依赖 origin 的功能可能需要这个,比如 cookie
  59. changeOrigin: true,
  60. pathRewrite: { '^/api4': '' },
  61. },
  62. },
  63. test: {
  64. '/api/': {
  65. target: 'http://192.168.0.14:52015/',
  66. changeOrigin: true,
  67. pathRewrite: { '^/api': '' },
  68. },
  69. },
  70. pre: {
  71. '/api/': {
  72. target: 'your pre url',
  73. changeOrigin: true,
  74. pathRewrite: { '^/api': '' },
  75. },
  76. },
  77. };