2015-10-08 51 views
1

這是我ionic.project允許跨源請求,我研究離子:沒有「訪問控制允許來源」標頭出現在所請求的資源

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

後發現,當我運行離子服務在我的CMD終端,它啓動瀏覽器,我得到這在控制檯上

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. 

什麼可能是錯的?

回答

1

至於我,我用這個插件與內容安全,策略操作:

cordova-plugin-whitelist

這幫助了我。

+0

我已經添加了幾次,沒有結果 – Blaze

+0

你在index.html中添加了這個嗎?

+0

這個在你的config.xml中 –

相關問題