uploadFileToOss 上传文件到阿里 oss

uploadFileToOss ^7.8

上传文件到阿里 oss

#请求参数

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

#引入接口模块

import bridge from '@minix-iot/etsbridge-sdk'

#接口调用示例

const params = {
  fileList: ['/xxx/xx.vue'], //本地文件路径
}
bridge
  .uploadFileToOss(params)
  .then((res) => {
    console.log(res)
  })
  .catch((err) => {
    console.log(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-28 16:36  AtlasLapetos  阅读(2)  评论(0)    收藏  举报