WEB插件开发-“iot-gateway”
更新时间:2017-12-18 17:44:28
简介
平台Web应用、Web插件,服务请求的库。
安装
bnpm install @bone/iot-gateway --save
使用
引用
import IotGateway, {axios} from '@bone/iot-gateway';
使用 Get
IotGateway
.get({url, apiVer, params})
.then(res => console.log(res))
.catch(res => console.log(res))
使用 Post
IotGateway
.post({url, apiVer, params})
.then(res => console.log(res))
.catch(res => console.log(res))
API
参数说明
参数 | 说明 | 类型 | 必要 | 默认值 |
---|---|---|---|---|
url | 接口服务地址 | String | true | - |
apiVer | 接口服务版本 | String | true | - |
params | 请求入参 | Object | false | - |
备注:可导出axios网络库,更多请参考 axios