# uploadLocalFile
上传本地文件
# 请求参数
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
operation | String | Y | 'uploadLocalFile' | 操作类型 |
# 参数代码示例
// 上传本地文件到 OSS
const params = {
files: [fileItem],
domain: 'https://oss.example.com',
path: '/upload/path',
requestHeader: { Authorization: 'Bearer xxx' },
requestParams: {},
timeoutInterval: 120,
method: 'PUT',
serviceType: '6'
}
this.$bridge.uploadLocalFile(
{ params },
(uploadData) => {
if (+uploadData.code === 0 && +uploadData.progress === 100) {
console.log('上传成功')
}
},
(error) => {
console.log('上传失败', error)
}
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23