【发布时间】:2020-09-10 23:38:05
【问题描述】:
我正在尝试实现还原功能,但有一个问题
revert(uniqueFileId, load, error) {
const desertRef = this.storage.ref().child(uniqueFileId);
desertRef.delete().then(function () {
const index = self.files.indexOf(uniqueFileId);
if (index > -1) {
self.files.splice(index, 1);
}
load();
}).catch(function (e) {
switch (e.code) {
case 'storage/canceled':
break;
default:
error(e.message)
}
});
},
完整来源 https://gist.github.com/boskiv/dd299cebcec4ca9ef8b8d792c7b4a420
在这种情况下,revert 函数中的uniqueFileId 包含来自存储的完整 URL。(https://firebasestorage.googleapis.com/v0/b/koko-date-dev.appspot.com/o/gifts%2FhfvhV6Iou15pBj1mhA8b)
在这种情况下是否可以选择只获取文件名而无需复杂的解析和字符串拆分
【问题讨论】:
标签: filepond