vue多个代理配置

vue.config

    devServer: {
        host: 'localhost',
        port: 8200,
        proxy: {
            '/api': {
                target: 'http://192.168.0.8:80', 
                changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
                ws: true,
                pathRewrite: {
                    '^/api': '/'
                }
            },
            '/noAuthorization': {
                target: 'http://192.168.0.8:8202',
                changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
                ws: true,
                pathRewrite: {
                    '^/noAuthorization': '/'
                }
            }
        }
    }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-02
  • 2021-05-14
  • 2022-12-23
  • 2021-08-08
  • 2021-11-16
猜你喜欢
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-28
相关资源
相似解决方案