【发布时间】:2021-09-17 02:06:47
【问题描述】:
我在我的 react 应用上设置 mangopay 时遇到问题。当我尝试获取特定用户的所有卡片时出现此错误:
Access to fetch at 'https://api.sandbox.mangopay.com/v2.01/oauth/token' from origin {URL} has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
POST https://api.sandbox.mangopay.com/v2.01/oauth/token net::ERR_FAILED
我正在尝试这样做:
const listAvailableCard = () => {
const cards = mangopay.Users.getCards(resp.UserId);
return cards;
}
有谁知道如何解决这个问题。考虑到我已经尝试过 SSL 证书服务而不是。
谢谢。 文森特
【问题讨论】:
标签: reactjs http cors mangopay