# downFile ^5.9.0
下载文件
# 请求参数
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
param | Object | Y | {}属性: url:{Type: String, Default: N/A, Description: 下载地址 } | 请求参数 |
# 接口调用示例
this.$bridge
.downFile(params)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
# 返回参数
- 成功时返回
| Prop | Type | Default | Description |
|---|---|---|---|
path | String | N/A | 下载文件本地路径(errorCode为0时有效) |
errorCode | Number | 0/1 | 0下载完成 / 1下载中 |
progress | Number | 1~100 | 下载进度(errorCode为1时有效) |
errorMessage | String | N/A | 下载错误时候的错误信息 |
- 失败时返回
| Prop | Type | Default | Description |
|---|---|---|---|
errorCode | Number | 0 | 状态码 //其他(不是0和1):下载出错 |
errorMessage | String | - | 下载错误时候的错误信息 |
TIP
该接口基于mSmart 协议,底层由singleBlueToothModule单蓝牙支持