标头授权ionic 3 / Woocomerce / Wordpress

时间:2018-08-30 21:36:28

标签: javascript wordpress typescript ionic3 woocommerce-rest-api

enter image description here

我认为我需要添加一些标头授权才能创建新客户.. 这是我的代码

signup(){

    let customerData = {
      customer : {}
    }

    customerData.customer = {
      "email": this.newUser.email,
      "first_name": this.newUser.first_name,
        ...
      "billing_address": {
        "first_name": this.newUser.first_name,
        ...
      },
      "shipping_address": {
        "first_name": this.newUser.first_name,
          ...

      }
    }

    if(this.billing_shipping_same){
      this.newUser.shipping_address = this.newUser.shipping_address;
    }
    this.WooCommerce.postAsync('customers', customerData).then( (data) => {

      console.log(JSON.parse(data.body));
    })

  }

我希望有人帮助我做到这一点

0 个答案:

没有答案