在Android中使用woocommerce rest api更改用户密码

问题描述 投票:5回答:1

我正在使用woocommerce rest API来构建电子商务Android应用程序。

我想使用woocommerce rest API实现更改密码,我已经参考了这个链接

https://woocommerce.github.io/woocommerce-rest-api-docs/但它不起作用。

我如何实现更改密码?

android wordpress woocommerce-rest-api
1个回答
0
投票

我使用Ionic3构建一个带有woocommerce作为后端的应用程序也遇到了同样的问题。

以下代码适用于我,但您需要找到一种方法来确定客户ID。

updateCustomer(){
    this.customer.id=YOUR_CUSTOMER_ID;
    this.customer.password = NEW_PASSWORD;
    this.WooCommerce.putAsync("customers/" + this.customer.id, {customer: this.customer}).then((res)=>{
      if(JSON.parse(res.body).customer){
        console.log('customer updated');
      }
    }, (err)=>{
      console.log(err.body)
    })
}
© www.soinside.com 2019 - 2024. All rights reserved.