You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

proxy.ts 1.5 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * @name 代理的配置
  3. * @see 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
  4. * -------------------------------
  5. * The agent cannot take effect in the production environment
  6. * so there is no configuration of the production environment
  7. * For details, please see
  8. * https://pro.ant.design/docs/deploy
  9. *
  10. * @doc https://umijs.org/docs/guides/proxy
  11. */
  12. export default {
  13. // 如果需要自定义本地开发服务器 请取消注释按需调整
  14. dev: {
  15. // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
  16. '/api/': {
  17. // 要代理的地址
  18. // target: 'http://172.20.32.181:31205',
  19. target: 'http://172.20.32.98:8082',
  20. // target: 'http://172.20.32.150:8082',
  21. // 配置了这个可以从 http 代理到 https
  22. // 依赖 origin 的功能可能需要这个,比如 cookie
  23. changeOrigin: true,
  24. pathRewrite: { '^/api': '' },
  25. },
  26. '/profile/avatar/': {
  27. target: 'http://172.20.32.181:31205',
  28. changeOrigin: true,
  29. },
  30. },
  31. /**
  32. * @name 详细的代理配置
  33. * @doc https://github.com/chimurai/http-proxy-middleware
  34. */
  35. test: {
  36. // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
  37. '/api/': {
  38. target: 'https://proapi.azurewebsites.net',
  39. changeOrigin: true,
  40. pathRewrite: { '^': '' },
  41. },
  42. },
  43. pre: {
  44. '/api/': {
  45. target: 'your pre url',
  46. changeOrigin: true,
  47. pathRewrite: { '^': '' },
  48. },
  49. },
  50. };