【发布时间】:2021-02-26 00:02:45
【问题描述】:
我正在使用一个允许本地主机 CORS 的 rest api。当我使用 ionic 应用程序的网络版本时,我按预期从服务器获得响应。但是当它来到android模拟器时 它给了我以下错误,我的 Api 只允许来自本地主机或我的域。如何解决这个问题?
**Msg: Failed to load https://myapi.com/GetAllUsersList: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header contains multiple values 'http://localhost, *', but only one is allowed. Origin 'http://localhost' is therefore not allowed access.**
【问题讨论】:
标签: android ionic-framework cors vuejs3