proxy.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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://open.test.luojigou.vip:8899',
  15. // target: 'http://192.168.1.2:38092',
  16. // target: 'https://preview.pro.ant.design',
  17. // 配置了这个可以从 http 代理到 https
  18. // 依赖 origin 的功能可能需要这个,比如 cookie
  19. changeOrigin: true,
  20. pathRewrite: { '^/api' : '' }
  21. },
  22. },
  23. test: {
  24. '/api/': {
  25. target: 'https://proapi.azurewebsites.net',
  26. changeOrigin: true,
  27. pathRewrite: { '^': '' },
  28. },
  29. },
  30. pre: {
  31. '/api/': {
  32. target: '',
  33. changeOrigin: true,
  34. pathRewrite: { '^': '' },
  35. },
  36. },
  37. };