uploadFileToOss 上传文件到阿里 oss

uploadFileToOss ^7.8

上传文件到阿里 oss

#请求参数

Prop Type Default Comment
fileList String N/A 本地文件路径 如['/xxx/xx.vue']

#接口调用示例

const params = {
    "fileList": ['/xxx/xx.vue'], //本地文件路径
}
this.$bridge
  .uploadFileToOss(params)
  .then(res => {
    this.$alert(res)
  })
  .catch(err => {
    this.$toast(err)
  })

#返回参数

  • 成功时返回
Prop Type Comment
code Number -
fileList(8.4版本新增) Array 上传后的URL [{"filePath":"本地路径", "fileUrl":"远程url"}, {"filePath":"本地路径", "fileUrl":"远程url"}]
msg String -

#接口返回示例

{
    "code": 0,
    "fileList":[{"filePath":"本地路径", "fileUrl":"远程url"}, {"filePath":"本地路径", "fileUrl":"远程url"}],
    "msg": "xxx",
    "progress": 50
}
posted on 2024-12-21 14:38  AtlasLapetos  阅读(10)  评论(0)    收藏  举报