软件工程日报18
解决跨域问题
跨域:由于浏览器的同源策略限制,向不同源发送ajax请求会失效
需要在前端配置代理
server: {
proxy: {
'/api': {//获取路径中包含api的请求
target: 'http://localhost:8080',//获取后台服务所在的源
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
},

浙公网安备 33010602011771号