sendElectronicRequest 发送商城请求

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'

#接口调用示例

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)
  })

#返回参数

  • 成功时返回
  • 失败时返回
posted on 2024-12-28 16:37  AtlasLapetos  阅读(8)  评论(0)    收藏  举报