WooCommerce + Ionic:无法注册和结帐 - Fetch API 无法加载 [英] WooCommerce + Ionic: Unable to signup and checkout - Fetch API cannot load

查看:32
本文介绍了WooCommerce + Ionic:无法注册和结帐 - Fetch API 无法加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am working on a project that integrates WooCommerce with Ionic 3 and I am having problems with the signup and checkout functionality. I am able to read products and login from my WooCommerce site, but every time I do a post request, I am getting these errors:

{"errors":[{"code":"woocommerce_api_authentication_error","message":"无效签名 - 提供的签名不匹配."}]}

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

我该如何解决?

推荐答案

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

Make sure you have the following code in your .htaccess file on the top. You can find this file in the root of your WordPress.

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

还要在您的浏览器上启用 CORS.

Also enable CORS on your browser.

这篇关于WooCommerce + Ionic:无法注册和结帐 - Fetch API 无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆