收藏
回答

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

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

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

const cloudPath = 'my-image.png'


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


回答关注问题邀请回答
收藏

1 个回答

  • Mr.Zhao
    Mr.Zhao
    2020-07-31

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

    2020-07-31
    有用 1
    回复 1
    • colouredglaze🌙
      colouredglaze🌙
      2020-07-31
      谢谢,突然感觉问了个好弱智的问题
      2020-07-31
      回复
登录 后发表内容
问题标签