请扫码查看示例
# uploadFileToOss ^7.8
上传文件到阿里 oss
# 请求参数
Prop | Type | Default | Comment |
---|---|---|---|
fileList | String | N/A | 本地文件路径 如['/xxx/xx.vue'] |
# 引入接口模块
import bridge from '@minix-iot/etsbridge-sdk'
1
# 接口调用示例
const params = {
fileList: ['/xxx/xx.vue'], //本地文件路径
}
bridge
.uploadFileToOss(params)
.then((res) => {
console.log(res)
})
.catch((err) => {
console.log(err)
})
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
# 返回参数
- 成功时返回
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
2
3
4
5
6
7
8