如何解决“重定向已被 CORS 策略阻止:没有“Access-Control-Allow-Origin”标头”?
<p>我正在使用 <code>Vue js</code> 开发一个应用程序。
根据我的设置,我需要在设置更改时将变量传递给我的 URL。</p>
<pre class="lang-js prettyprint-override"><code><!-- language: lang-js -->
$.get('http://172.16.1.157:8002/firstcolumn/' + c1v + '/' + c1b, function (data) {
// some code...
});
</code></pre>
<p>但是当我的应用程序点击 URL 时,它会显示以下消息。</p>
<pre class="brush:php;toolbar:false;">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.</pre>
<p><br /></p>