vue-element-admin 跨域问题:我在使用proxy后,GET请求可以跨域,但是POST请求无法跨域

0s0u357o  于 21天前  发布在  其他
关注(0)|答案(3)|浏览(23)

配置如下
proxy: {
'/dev-api': {
target: ' http://localhost:8000 ',
ws: true,
changeOrigin: true,
secure: false,
pathRewrite: {
'^/dev-api': '/'
}
}
}

gk7wooem

gk7wooem1#

Access to XMLHttpRequest at ' http://139.196.232.39:9000/login.jsp ' (redirected from ' http://localhost:9528/data/table_list?page=0&size=10&searchText= ') from origin ' http://localhost:9528 ' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
您好请问您一下,项目以上的错误,是不是我代理出现了问题呢,页面如果间隔一段时间不操作,刷新页面就会一直报错,请问时代理出现而导致的问题吗,烦请给点提示呢。 谢谢!

zour9fqk

zour9fqk2#

Access to XMLHttpRequest at ' http://139.196.232.39:9000/login.jsp ' (redirected from ' http://localhost:9528/data/table_list?page=0&size=10&searchText= ') from origin ' http://localhost:9528 ' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
您好请问您一下,项目以上的错误,是不是我代理出现了问题呢,页面如果间隔一段时间不操作,刷新页面就会一直报错,请问时代理出现而导致的问题吗,烦请给点提示呢。 谢谢!

这个可能是你的session过期了,然后导致需要重新去请求公共的权限接口,然后那个接口不支持跨域造成的

8hhllhi2

8hhllhi23#

请问这个怎么解决呢,我也觉得有您说的过期意思,因为是间隔一段时间刷新页面才出现的报错,但是我思考了很久没找到方法,请问您这个需要怎么配置呢。 在 2020-05-09 10:30:21,"DanMaster" notifications@github.com 写道: Access to XMLHttpRequest at ' http://139.196.232.39:9000/login.jsp ' (redirected from 'http://localhost:9528/data/table_list?page=0&size=10&searchText=') from origin 'http://localhost:9528' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute. 您好请问您一下,项目以上的错误,是不是我代理出现了问题呢,页面如果间隔一段时间不操作,刷新页面就会一直报错,请问时代理出现而导致的问题吗,烦请给点提示呢。 谢谢! 这个可能是你的session过期了,然后导致需要重新去请求公共的权限接口,然后那个接口不支持跨域造成的 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

相关问题