vuecli3 配置多个代理

it2025-01-10  15

module.exports = { devServer: { proxy: { '/api1': { target: 'api1_url', ws: true, /* 允许跨域 */ changeOrigin: true, pathRewrite: { '^/api1': '' } }, '/api2': { target: 'api2_url', ws: true, /* 允许跨域 */ changeOrigin: true, pathRewrite: { '^/api2': '' } } } } }

 

最新回复(0)