简体   繁体   English

ionic:请求的资源上不存在“ Access-Control-Allow-Origin”标头

[英]ionic: No 'Access-Control-Allow-Origin' header is present on the requested resource

This is my ionic.project to allow Cross Origin Request that I found after research 这是我的ionic.project,允许在研究后找到跨源请求

{
  "name": "AppName",
  "app_id": "",
  "proxies": [
    {
      "path": "/path",
      "proxyUrl": "http://www.url.com/path"
    }
  ]
}

When I run ionic serve on my cmd terminal, it launches the browser and I get this on the console 当我在cmd终端上运行ionic serve时,它会启动浏览器,并在控制台上显示

XMLHttpRequest cannot load http://www.url.com/Token. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.

What could be wrong? 有什么事吗

As for me, I used this plugin to manipulate with Content-Security-Policy: 对我而言,我使用此插件来操作Content-Security-Policy:

cordova-plugin-whitelist 科尔多瓦-插件白名单

This helped me. 这对我有帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 模型查看器颤动请求的资源上不存在“Access-Control-Allow-Origin”标头 - modelviewer flutter No 'Access-Control-Allow-Origin' header is present on the requested resource Android WebView“请求的资源上不存在'Access-Control-Allow-Origin'标头” - Android WebView “No 'Access-Control-Allow-Origin' header is present on the requested resource” JSON_2_Region.json。 所请求的资源上没有“ Access-Control-Allow-Origin”标头。 因此,不允许访问原始“空”。 - JSON_2_Region.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. WebView不存在“ Access-Control-Allow-Origin”标头[ANDROID] - WebView No 'Access-Control-Allow-Origin' header is present [ANDROID] Google Cast:加载元数据错误并且不存在Access-Control-Allow-Origin标头 - Google Cast: Load Metadata Error and No Access-Control-Allow-Origin header is present Heroku上的Meteor移动服务器-不存在Access-Control-Allow-Origin标头 - Meteor Mobile Server on Heroku - No Access-Control-Allow-Origin header is present 离子怪异的“访问控制允许来源”问题 - Ionic weird 'Access-Control-Allow-Origin' issue 科尔多瓦没有访问控制允许来源 - cordova No Access-Control-Allow-Origin 如何解决“ CORS策略:“ Access-Control-Allow-Origin”标头的值不等于提供的来源。” - How to solve "CORS policy: The 'Access-Control-Allow-Origin' header has a value that is not equal to the supplied origin.'? android webview - 访问控制允许来源 - android webview - Access-Control-Allow-Origin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM