# sendCentralCloudRequest ^5.0.0
发送给中台的通用网络请求接口
# 请求参数
Prop | Type | Required | Default | Description |
---|---|---|---|---|
url | string | Y | '' | 请求url |
param | Object | N | {} 属性: method: {Type: String, Default: POST, Description: 请求的方式: POST (默认) / GET (get请求时android需要调用方自己将参数拼接到url后面)} headers: {Type: Object, Default: {}, Description: 请求header } data: {Type: Object, Default: {}, Description: 请求参数 } bizType: { // ^6.1.0Type: String, Default: 0 ,Description: (业务类型 0 IoT请求(默认) / 1 中国区请求, 注:当bizType为1时,APP将在请求header中增加sukey(中国区登录态)信息} | 请求参数 |
options | Object | N | 默认:{ isShowLoading: true } | 默认展示loading |
tip
当bizType
为1
时,APP将在请求 header 中增加 sukey (中国区登录态)信息
# 接口调用示例
this.$bridge
.sendCentralCloudRequest('gateway/subdevice/search', {
method: 'POST', //POST/GET, 默认POST
headers: {}, //请求header
data: {} //请求参数
})
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
# 返回参数
- 成功时返回
-
请求成功时,原生原样转发接口返回,具体返回参数需参照各个接口的返回定义。
- 失败时返回
Prop | Type | Default | Description |
---|---|---|---|
errorCode | Number | N/A | 999999 没有网络 4XX 客户端错误 5XX 服务端错误 |
errorMessage | String | N/A | 本地错误信息 |