proxy.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. '/api/': {
  16. target: 'https://api.zanxiangwl.com',
  17. changeOrigin: true,
  18. pathRewrite: { '/api': '' },
  19. },
  20. '/gameApi/': {
  21. target: 'https://game.84game.cn',//服务器
  22. changeOrigin: true,
  23. pathRewrite: { '^/gameApi/': '' },
  24. },
  25. },
  26. /**
  27. * @name 详细的代理配置
  28. * @doc https://github.com/chimurai/http-proxy-middleware
  29. */
  30. test: {
  31. // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
  32. '/api/': {
  33. target: 'https://game.84game.cn',
  34. changeOrigin: true,
  35. pathRewrite: { '^': '' },
  36. },
  37. },
  38. pre: {
  39. '/api/': {
  40. target: 'your pre url',
  41. changeOrigin: true,
  42. pathRewrite: { '^': '' },
  43. },
  44. },
  45. };