【问题标题】:Change user password using woocommerce rest api in Android在 Android 中使用 woocommerce rest api 更改用户密码
【发布时间】:2017-04-18 04:30:15
【问题描述】:
【问题讨论】:
标签:
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)
})
}