解决console控制台反复打印“WebSocket connection to ‘ws://192.168.******/sockjs-node/470/djhbq40w/websock

原文链接: https://fullsmilespace.com/?p=304

原文链接:https://fullsmilespace.com/?p=304

vue.config.js中配置devServer.proxy的ws为false

  1. module.exports = {
  2. devServer: {
  3. proxy: {
  4. '/': {
  5. ws: false, // proxy websockets
  6. target: 'http://192.168.11.172:8090',
  7. pathRewrite: {
  8. '^/': '/bpp/'
  9. },
  10. cookiePathRewrite: {
  11. '/bpp': '/'
  12. }
  13. }
  14. }
  15. },
  16. baseUrl: process.env.NODE_ENV === 'production' ? '/bpp' : '/'
  17. }

你可能感兴趣的:(vue)