canlUse 版本可用性

canlUse ^6.8

获取某个 1 API 在当前版本是否可用

#请求参数

Prop Type Default Comment
params String N/A 接口 url

#引入接口模块

import bridge from '@minix-iot/etsbridge-sdk'

#接口调用示例

let params = 'getSystemInfo'
bridge
  .canIUse(params)
  .then((res) => {
    console.log(res)
  })
  .catch((err) => {
    console.log(err)
  })

#返回参数

  • 成功时返回
Prop Type Value
enable Boolean `true
  • 失败时返回(api 为空或者没有)
Prop Type Value
code Number -2
msg String json 解析失败

#返回示例

{
  "enabled": true //true or false
}
posted on 2024-12-26 15:04  AtlasLapetos  阅读(6)  评论(0)    收藏  举报