云开发上传文件路径问题?

发布于 8 年前作者 jun97675 次浏览最后编辑 8 年前来自 issues

const cloudPath = 'my-image' + filePath.match(/\.[^.]+?$/)[0]

以上我没明白为什么要这样写?

const cloudPath = 'my-image.png'


也可以呀?为什么要 +  filePath.match(/\.[^.]+?$/)[0]


1 回复
lei05
lei051 楼5 年前

打印一下filePath.match(/\.[^.]+?$/)[0] 不就知道了,别纸上谈兵