Proxy error: Could not proxy request /login from localhost:8090 to http://:8089. See https://nodejs.

Proxy error: Could not proxy request /login from localhost:8090 to http://:8089.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ENOTFOUND).

检查vue.config.js文件
修改target:标签

  devServer: {
    
    
    port: 8090,
    // host: '192.168.1.101',
    https: false,
    hotOnly: false,
    proxy: {
    
    
      '/api': {
    
    
        // login-Post地址
        target: 'http://localhost:8089',
        changeOrigin: true,
        secure: false,
        pathRewrite: {
    
    
          '^/api': ''
        }
      }
    }
  },

猜你喜欢

转载自blog.csdn.net/d347091231/article/details/121491101