我使用Yeoman发生器(
https://github.com/diegonetto/generator-ionic)设置了Ionic开发环境.一切都运作良好.
问题在于Sever方面的请求,我收到了Cross-Origin Request Blocked错误.
我在.htaccess文件和AngularJS app.js中添加以下链接,仍然得到相同的错误
Header set Access-Control-Allow-Origin "*" Header set Access-Control-Allow-Headers: Authorization
AngularJS Provider
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; $httpProvider.defaults.withCredentials = true;
我收到的错误消息是
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.
请求屏幕&响应标题
请指导我为启用CORS而需要更改的任何配置.我们的服务器端框架是Zend 1.x.
解决方法
您的浏览器强制使用交叉源,不应使用当前设置阻止从任何分布式电话运行应用程序.
要允许“服务于浏览器”应用程序与服务器之间的通信,请使用浏览器插件