我正在使用Dropbox API从我拥有的照片文件夹中获取文件,而我最终想要做的是获取每个文件的临时链接。这是我的代码 - 如果有帮助,我也使用React:
componentDidMount() {
dbx.filesListFolder({ path: '/my-photos' })
.then(res => res.entries.map(file => file.path_display))
.then(res => {
let photoArray = res.map(path => dbx.filesGetTemporaryLink({ path: path }));
console.log(photoArray);
});
}
我在_result对象中收到了temp,但似乎我不应该访问它。
谁能告诉我Promise $ 2的含义以及如何解决这个问题?
Promise$2
是来自promise库的Promise
构造函数的名称,它与其他模块捆绑在一起,并在此过程中由转换器重命名,以避免与其他Promise
变量(最值得注意的是全局变量)发生冲突。