05axios跨域问题
axios跨域问题
devServer: {
proxy: {
'/api': {
target: '目标服务器地址加端口号:http://127.0.0.1:80',
ws: true,
pathRewrite: {
'^/api': '/'
}
}
}
}参考
Last updated
devServer: {
proxy: {
'/api': {
target: '目标服务器地址加端口号:http://127.0.0.1:80',
ws: true,
pathRewrite: {
'^/api': '/'
}
}
}
}Last updated
const request = axios.create({
baseURL: 'http://localhost:8080/api',
timeout: 12000,
headers: {
'content-Type': 'application/json',
Accept: 'application/json',
},
}) request.post('/test', formData)