proxy.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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: 'https://preview.pro.ant.design',
  15. // 配置了这个可以从 http 代理到 https
  16. // 依赖 origin 的功能可能需要这个,比如 cookie
  17. changeOrigin: true,
  18. },
  19. '/web/': {
  20. // 要代理的地址
  21. target: 'http://yongxu.yehaoji.cn:8199', // 开发
  22. // target: 'https://app.yongxulvjian.com', // 生产
  23. changeOrigin: true,
  24. },
  25. '/s/': {
  26. // 要代理的地址
  27. target: 'http://192.168.0.224:18199/',
  28. changeOrigin: true,
  29. },
  30. },
  31. test: {
  32. '/api/': {
  33. target: 'https://proapi.azurewebsites.net',
  34. changeOrigin: true,
  35. pathRewrite: { '^': '' },
  36. },
  37. },
  38. pre: {
  39. '/api/': {
  40. target: 'your pre url',
  41. changeOrigin: true,
  42. pathRewrite: { '^': '' },
  43. },
  44. },
  45. };