我想在我的Web应用程序中实现Paypal SDK。
API连接在节点/快速后端的端点中进行管理。我必须从react前端向此终结点进行此axios调用,而后者又必须将我重定向到PayPal。这导致我得到错误
XMLHttpRequest无法加载http://sandbox.paypal.com。没有 请求中存在“ access-control-allow-origin”标头 资源。因此,不允许访问原始“空”。
我使用的是cors软件包,当我将标题添加到标头的PayPal链接时,该错误就是这样的抱怨:
var input = [
{label: "Campaign 3",value:3},{label: "Campaign 1",value:1},{label: "Campaign 4",value:2},{label: "Campaign 6",value:5},];
var output = input.map(x => x.value);
console.log(output);
我得到这样的错误:
XMLHttpRequest无法加载http://localhost:5000。没有 请求中存在“ access-control-allow-origin”标头 资源。因此,不允许访问原始“空”。
http://localhost:5000是我的React客户。看起来可能无法使用axios调用来执行此操作,但是对此有任何解决方案吗?