proxy.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. '/server/': {
  13. // 要代理的地址
  14. target: 'https://duoduoenv.sagacloud.cn/',
  15. // 配置了这个可以从 http 代理到 https
  16. // 依赖 origin 的功能可能需要这个,比如 cookie
  17. changeOrigin: true,
  18. // pathRewrite: { '^/': '' },
  19. },
  20. '/api2/': {
  21. // 要代理的地址
  22. //target: 'http://192.168.0.14:52010/',
  23. target: 'http://api.sagacloud.cn/',
  24. // 配置了这个可以从 http 代理到 https
  25. // 依赖 origin 的功能可能需要这个,比如 cookie
  26. changeOrigin: true,
  27. pathRewrite: { '^/api2': '' },
  28. },
  29. '/api': {
  30. target: 'https://duoduoenv.sagacloud.cn/',
  31. // target: 'http://192.168.12.13:52011/',
  32. changeOrigin: true,
  33. pathRewrite: {
  34. '^/api': '',
  35. },
  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. };