proxy 跨域
javascript
server: {
proxy: {
'/api': {
target: 'https://baidu.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
},
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9