# requestDataTransmit
请求数据透传
# 调用方式
requestDataTransmit(params = {})
1
返回 Promise,使用 then/catch 或 await 处理结果。 可省略参数对象,此时传入空对象;不额外接收位置形式的成功/失败回调。
# 请求参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| params | Object | N | {} | 透传参数 |
| params.type | String | N | 宿主当前插件类型 | 服务类型;未传或为空时按旧文档由宿主处理 |
| params.queryStrings | String | N | — | 请求查询字符串,与 H5 接口约定一致 |
| params.transmitData | String | N | — | 透传内容,与 H5 接口约定一致 |
# 接口调用示例
const params = { type: 'example-type', queryStrings: '', transmitData: '' }
this.$bridge.requestDataTransmit(params)
.then(res => {
console.log(res)
})
.catch(error => {
console.error(error)
})
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
# 返回参数
返回 Promise,成功时返回解析后的原生结果,失败时 reject 原生错误。