解决前后端同一个端口跨域问题
前端起了一个代理
如果url是api开头的自动代理访问8080端口(解决前后端端口不一致要么是前端代理,要么是后端加过滤器)
proxy:{'/api':{target:'http://localhost:8080',changeOrigin : true,// 替换去掉路径上的api// rewrite:(path)=>path.replace(/^\/api/,'')}},
前端起了一个代理
如果url是api开头的自动代理访问8080端口(解决前后端端口不一致要么是前端代理,要么是后端加过滤器)
proxy:{'/api':{target:'http://localhost:8080',changeOrigin : true,// 替换去掉路径上的api// rewrite:(path)=>path.replace(/^\/api/,'')}},