【发布时间】:2015-02-05 03:28:40
【问题描述】:
我在测试 Angular 应用时使用 Wamp 作为本地服务器。
我正在使用$resource 从我的服务器获取一些 api 数据,但我收到了一条消息
XMLHttpRequest cannot load http://myproj.herokuapp.com/api/projects?name=demo.
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 401.
我在网络上进行了广泛搜索,但找不到解决此问题的有效方法。
有什么新鲜的想法吗?有人解决过这个问题吗?
【问题讨论】:
标签: angularjs