WooCommerce + Ionic:无法注册和结帐 - Fetch API 无法加载

WooCommerce + Ionic: Unable to signup and checkout - Fetch API cannot load

我正在开发一个将 WooCommerce 与 Ionic 3 集成的项目,但我在注册和结帐功能方面遇到了问题。我可以从我的 WooCommerce 网站阅读产品和登录,但每次我发出 post 请求时,我都会收到这些错误:

{"errors":[{"code":"woocommerce_api_authentication_error","message":"Invalid signature - provided signature does not match."}]}

我该如何解决?

确保在顶部的 .htaccess 文件中包含以下代码。您可以在 WordPress 的根目录中找到此文件。

RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $l [R=200,L]

同时在您的浏览器上启用 CORS。