# 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, res => {
    this.$alert(res)
  }, err => {
    this.$toast(err)
  })
1
2
3
4
5
6
7
8
9

# 返回参数

  • 成功时返回
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
}


1
2
3
4
5
6
7
8
Last Updated: 5/7/2024, 9:08:45 AM