I am working on a app using vue js.(我正在使用vue js开发应用程序。)
$.get('http://172.16.1.157:8002/firstcolumn/' + c1v + '/' + c1b, function (data) { // some code... });
but when my app hit on url, it shows following messsge.(但是当我的应用程序点击url时,显示以下消息。)
Failed to load http://172.16.1.157:8002/firstcolumn/2017-03-01/2017-10-26 : Redirect from ' http://172.16.1.157:8002/firstcolumn/2017-03-01/2017-10-26 ' to ' http://172.16.1.157:8002/firstcolumn/2017-03-01/2017-10-26/ ' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.(无法加载http://172.16.1.157:8002/firstcolumn/2017-03-01/2017-10-26 :从' http://172.16.1.157:8002/firstcolumn/2017-03-01/2017-重定向10-26 '到' http://172.16.1.157:8002/firstcolumn/2017-03-01/2017-10-26/ '已被CORS策略阻止:没有'Access-Control-Allow-Origin'标头存在于请求的资源上。) Origin ' http://localhost:8080 ' is therefore not allowed access.(因此,不允许访问源' http:// localhost:8080 '。)
Failed to load http://172.16.1.157:8002/firstcolumn/2017-03-01/2017-10-26 : Redirect from ' http://172.16.1.157:8002/firstcolumn/2017-03-01/2017-10-26 ' to ' http://172.16.1.157:8002/firstcolumn/2017-03-01/2017-10-26/ ' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.(无法加载http://172.16.1.157:8002/firstcolumn/2017-03-01/2017-10-26 :从' http://172.16.1.157:8002/firstcolumn/2017-03-01/2017-重定向10-26 '到' http://172.16.1.157:8002/firstcolumn/2017-03-01/2017-10-26/ '已被CORS策略阻止:没有'Access-Control-Allow-Origin'标头存在于请求的资源上。)
In addition to what awd mentioned about getting the person responsible for the server to reconfigure (an impractical solution for local development) I use a change-origin chrome plugin like this:(除了awd提到的有关让负责服务器的人员进行重新配置(本地开发的不切实际的解决方案)外,我还使用了类似更改的chrome插件:)
https://chrome.google.com/webstore/detail/moesif-origin-cors-change/digfbfaphojjndkpccljibejjbppifbc(https://chrome.google.com/webstore/detail/moesif-origin-cors-change/digfbfaphojjndkpccljibejjbppifbc)
You can make your local dev server (ex: localhost:8080) to appear to be coming from 172.16.1.157:8002 or any other domain .(您可以将local dev server (ex: localhost:8080)显示为来自172.16.1.157:8002 or any other domain 。)
local dev server (ex: localhost:8080)
172.16.1.157:8002 or any other domain
2.1m questions
2.1m answers
60 comments
57.0k users