proxy.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. },
  29. test: {
  30. '/api/': {
  31. target: 'http://192.168.0.14:52015/',
  32. changeOrigin: true,
  33. pathRewrite: { '^/api': '' },
  34. },
  35. },
  36. pre: {
  37. '/api/': {
  38. target: 'your pre url',
  39. changeOrigin: true,
  40. pathRewrite: { '^/api': '' },
  41. },
  42. },
  43. };