中泽后台管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

proxy.ts 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. secure: false,
  19. // changeOrigin: true,// 依赖 origin 的功能可能需要这个,比如 cookie;
  20. target: 'http://192.168.1.33:9100',//李琦;
  21. //target: 'http://192.168.1.69:9400',//69测试环境;
  22. //target: 'http://www.wbvis.com/cpgw-back',//正式环境;
  23. pathRewrite: { '^/api': '' },
  24. // target: 'https://192.168.1.84',//李琦不在用以下这两行;
  25. // pathRewrite: { '^/api': '/api/' },
  26. },
  27. '/profile/avatar/': {
  28. target: 'http://localhost:8080',
  29. changeOrigin: true,
  30. },
  31. '/otherProxy': {
  32. target: 'http://192.168.1.113:9601', //柳森本地数据;
  33. changeOrigin: true,
  34. pathRewrite: { '^/otherProxy': '' },
  35. },
  36. '/myPage': {
  37. target: 'http://localhost:3000', //柳森本地数据;
  38. changeOrigin: true,
  39. pathRewrite: { '^/myPage': '' },
  40. },
  41. },
  42. /**0
  43. * @name 详细的代理配置
  44. * @doc https://github.com/chimurai/http-proxy-middleware
  45. */
  46. test: {
  47. // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
  48. '/api/': {
  49. target: 'https://proapi.azurewebsites.net',
  50. changeOrigin: true,
  51. pathRewrite: { '^': '' },
  52. },
  53. },
  54. pre: {
  55. '/api/': {
  56. target: 'your pre url',
  57. changeOrigin: true,
  58. pathRewrite: { '^': '' },
  59. },
  60. },
  61. };