【发布时间】:2018-05-24 22:28:49
【问题描述】:
const config = {
headers: { "Content-Type": "application/octet-stream" }
}
let files = this.state.files
let promises = []
files.map((item ,index) => {
promises.push(axios.put(this.props.deal.authURL[index], item, config))
})
我收到此错误:
Uncaught (in promise) TypeError: Cannot read property 'protocol' of undefined
我的目标是将 Axios 调用的所有结果存储在 promises 数组中。然后使用Promise.all() 函数一次性解决所有问题。无法弄清楚为什么会出现错误。
感谢任何形式的帮助。谢谢
【问题讨论】:
-
由于您显示的代码不包含
protocol的任何内容,您可能显示错误的代码