3 回答

TA貢獻1780條經(jīng)驗 獲得超1個贊
Open react-native-woocommerce-api.js in node_modules\react-native-woocommerce-api\lib\
然后轉到第 195 行(_getOAuth().authorize 函數(shù))并更改:
params.qs = this._getOAuth().authorize({
url: url,
method: method
});
自
params.qs = this._getOAuth().authorize({
url: url + '?' + this.join(data, '&'),
method: method
});

TA貢獻1810條經(jīng)驗 獲得超4個贊
WooCommerce.get('products?per_page=100&page=1', {}) // YOu can set a Variable in-place of 1 and index 100 is the limit
較舊的 API 版本
https://Yoursite/wc-api/v3/products?filter[limit] =-1
希望這有幫助

TA貢獻1817條經(jīng)驗 獲得超14個贊
WooCommerce.get('products', {per_page: 50})
.then(res => {
this.setState({
data: res,
isLoading: false
});
})
.catch(error => {
console.log(error);
this.setState({
error,
isLoading: true
});
});
這應該有效!
- 3 回答
- 0 關注
- 121 瀏覽
添加回答
舉報