Access to XMLHttpRequest at ‘https://www.wanandroid.com/banner/json’ from origin ‘http://localhost:8080’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

proxy: {
‘/api’: {
target: ‘https://www.wanandroid.com’, //对应自己的接口
changeOrigin: true,
ws: true,
pathRewrite: {
‘^/api’: ‘’
}
}
}
我这么代理的,倒是不报跨域问题了,它还是localhost:8080请求的接口
这种办法试了,也没管用,有大神知道的吗,我调的玩Android的api,欢迎给我留言

Logo

前往低代码交流专区

更多推荐