vue代理,请求超时
vue代理代码
//代理
proxy: {
//配置名称
'/api': {
timeout: 480000,
proxyTimeout: 480000,
// 你要访问的目标地址
target: 'http://localhost:8080',
//允许跨域
changeOrigin: true,
ws:true,
//路径重写
pathRewrite: {
'^/api': '', // 需要重写的地址
},
headers:{
'Access-Control-Allow-Origin':'*'
}
}
}
}
}