proxy-dev.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * @Descripttion:
  3. * @version:
  4. * @Author: wt
  5. * @Date: 2023-01-29 13:14:08
  6. * @LastEditors: wt
  7. * @LastEditTime: 2023-04-14 19:25:59
  8. */
  9. "use strict";
  10. // 跨域请求设置,可配置多个
  11. module.exports = {
  12. port: 81,
  13. //localhost: '172.16.120.200',
  14. // 本地配置ip访问(手机可通过IP访问),需要修改成本地Ip地址
  15. localhost: "172.200.50.18",
  16. table: {
  17. "/prod-api": {
  18. // target: 'http://32.0.15.107:8080/prod-api', //线上-107测试服务器
  19. target: 'https://mhxfzd.shmh.gov.cn/prod-api', //线上-8083测试服务器
  20. // target: 'http://10.236.244.108:80/prod-api', //线上-8083测试服务器
  21. // target: "http://park.usky.cn/prod-api", //线上-20正式服务器
  22. // target: 'http://172.16.120.165:801/dev-api', //165
  23. // target: 'http://32.0.15.107:8080/api/', //闵行线上发布时
  24. // ws: true, // 代理websockets
  25. changeOrigin: true,
  26. pathRewrite: {
  27. //'^/api1' 是一个正则表达式,作用:将 /api1 提换成为 /
  28. "^/prod-api": "/",
  29. },
  30. },
  31. "/api": { //和mhapi互换
  32. // 原有api
  33. // target: 'http://32.0.15.107:8080/api/', //杨强闵行
  34. // target: 'http://32.0.15.107:8080/api',
  35. // target: 'http://10.236.244.108:80/api',
  36. target: 'https://mhxfzd.shmh.gov.cn/api',
  37. ws: true, // 代理websockets
  38. changeOrigin: true,
  39. pathRewrite: {
  40. //'^/api' 是一个正则表达式,作用:将 /api 提换成为 /
  41. "^/api": "/",
  42. },
  43. },
  44. // "/mhapi": {//和api互换
  45. // // target: "http://172.16.120.165:13200/mhapi", //165
  46. // // target: "http://park.usky.cn/mhapi", //20
  47. // target: "http://32.0.15.107:8080/mhapi", //107
  48. // ws: true, // 代理websockets
  49. // changeOrigin: true,
  50. // pathRewrite: {
  51. // //'^/api4' 是一个正则表达式,作用:将 /api4 提换成为 /
  52. // "^/mhapi": "/",
  53. // },
  54. "/video-api": {
  55. // 执法仪视频
  56. target: "http://10.107.31.215:50080/video-api",
  57. ws: true, // 代理websockets
  58. changeOrigin: true,
  59. pathRewrite: {
  60. //'^/api' 是一个正则表达式,作用:将 /api 提换成为 /
  61. "^/video-api": "/",
  62. },
  63. },
  64. "/video": {
  65. // 执法仪视频
  66. target: "http://32.0.15.107:8080/video-api",
  67. ws: true, // 代理websockets
  68. changeOrigin: true,
  69. pathRewrite: {
  70. //'^/api' 是一个正则表达式,作用:将 /api 提换成为 /
  71. "^/video": "/",
  72. },
  73. },
  74. }
  75. };