【问题标题】:Change user password using woocommerce rest api in Android在 Android 中使用 woocommerce rest api 更改用户密码
【发布时间】:2017-04-18 04:30:15
【问题描述】:

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

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

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

如何实现修改密码?

【问题讨论】:

    标签: android wordpress woocommerce-rest-api


    【解决方案1】:

    我在使用 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)
        })
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-01-21
      • 1970-01-01
      • 1970-01-01
      • 2018-01-07
      • 1970-01-01
      • 2014-06-10
      • 2017-01-22
      相关资源
      最近更新 更多