离子 - 跨源请求被阻止的问题

Mut*_*. V 4 .htaccess cors angularjs ionic-framework

我使用Yeoman生成器设置了Ionic开发环境(https://github.com/diegonetto/generator-ionic).一切都运作良好.

问题在于Sever方面的请求,我收到了Cross-Origin Request Blocked错误.

我在.htaccess文件和AngularJS app.js中添加以下链接,仍然得到相同的错误

Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers: Authorization
Run Code Online (Sandbox Code Playgroud)

AngularJS Provider

$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
$httpProvider.defaults.withCredentials = true;
Run Code Online (Sandbox Code Playgroud)

我收到的错误消息是

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at 
http://192.168.1.18/tracker/user/login. 
This can be fixed by moving the resource to the same domain or enabling CORS.
Run Code Online (Sandbox Code Playgroud)

请求和响应标头的屏幕

请求和响应标头的屏幕

请指导我为启用CORS而需要更改的任何配置.我们的服务器端框架是Zend 1.x.

Ben*_*ant 10

您的浏览器强制使用交叉源,不应使用当前设置阻止从任何分布式电话运行应用程序.

要允许"服务于浏览器"应用程序与服务器之间的通信,请使用浏览器插件

Allow-Control-Allow-Origin:*Chrome插件可以完成工作