请扫码查看示例
 # sendElectronicRequest ^6.8
发送商城请求
# 请求参数
| Prop | Type | Default | Comment | 
|---|---|---|---|
| method | String | N/A | POST/GET, 默认 POST | 
| hostUrl | String | N/A | 接口 host | 
| data | Object | N/A | 请求参数 | 
| headers | Object | N/A | 请求 header | 
| secret | String | N/A | 电商的 appSecret,可选,默认不传 | 
| url | String | N/A | 接口 url | 
# 引入接口模块
import bridge from '@minix-iot/etsbridge-sdk'
1
# 接口调用示例
const params = {
  data: {
    nonceid: '1624261250',
    appId: 'test_assets',
    source: 'APP',
    version: '7.7.0.1_2021061017',
    bizargs: { pageno: '1', pagesize: '20', state: 4 },
  },
  method: 'GET',
  headers: {
    'Content-Type': 'application/json;charset=utf-8',
  },
  url: '/next/outer_assets/getoutcouponlist',
  hostUrl: 'http://sitm.midea.cn',
}
bridge
  .sendElectronicRequest(params)
  .then((res) => {
    console.log(res)
  })
  .catch((err) => {
    console.log(err)
  })
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
# 返回参数
- 成功时返回 
- 失败时返回