I'm developing an application using Vue js
. Based on my setup, I need to pass variables to my URL when the settings change.
$.get('http://172.16.1.157:8002/firstcolumn/' c1v '/' c1b, function (data) { // some code... });
But when my app clicks on the URL, it displays the following message.
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. Origin 'http://localhost:8080' is therefore not allowed access.
Thank you everyone, I solved it through this extension on Chrome.
Allow CORS: Access-Control-Allow-Origin一个>
In addition to having the person responsible for the server reconfigure as awd mentioned (an impractical solution for local development), I also used a change source chrome plugin like this:
Moesif Orign and CORS Converter(used to be free but now want a work email address>_>)You can make your
local development server (eg: localhost:8080)
appear to be coming from172.16.1.157:8002 or any other domain
.