proxy-dev.js 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. target: "https://mhxfzd.shmh.gov.cn/video-api",
  58. ws: true, // 代理websockets
  59. changeOrigin: true,
  60. pathRewrite: {
  61. //'^/api' 是一个正则表达式,作用:将 /api 提换成为 /
  62. "^/video-api": "/",
  63. },
  64. },
  65. "/video": {
  66. // 执法仪视频
  67. target: "http://32.0.15.107:8080/video-api",
  68. ws: true, // 代理websockets
  69. changeOrigin: true,
  70. pathRewrite: {
  71. //'^/api' 是一个正则表达式,作用:将 /api 提换成为 /
  72. "^/video": "/",
  73. },
  74. },
  75. }
  76. };