static getIndexProductList(id) { let params = { "productCategoryId": id, "pageNum": 1, "pageSize": 3} return API.post('product/list', params).then( res => res.data ).catch((err) => { })}product.getProductCategory().then((res) => { //this._getProductList(res.data) let lists = res.data.map((item) => { return product.getIndexProductList(item.id).then((res) => { //console.log(res.data.list) return res.data.list }) }) console.log(lists) })我廟接口返回的數據應該是這樣的但是我上面這樣寫 返回的就是這樣的 也能返回數據 但是我該怎么取得數據呢
關于promise的問題
Smart貓小萌
2019-02-20 17:14:32