angularjs – 离子 – 跨源请求被阻止的问题
发布时间:2020-12-17 17:57:59 所属栏目:安全 来源:网络整理
导读:我使用Yeoman发生器( https://github.com/diegonetto/generator-ionic)设置了Ionic开发环境.一切都运作良好. 问题在于Sever方面的请求,我收到了Cross-Origin Request Blocked错误. 我在.htaccess文件和AngularJS app.js中添加以下链接,仍然得到相同的错误 He
我使用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. 解决方法
您的浏览器强制使用交叉源,不应使用当前设置阻止从任何分布式电话运行应用程序.
要允许“服务于浏览器”应用程序与服务器之间的通信,请使用浏览器插件 Allow-Control-Allow-Origin: * Chrome Plugin做的工作 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |