getFitUnlockMethodList

版本要求:
@ray-js/lock-sdk≥1.2.0

方法签名
getFitUnlockMethodList(params: )

描述

获取配件下指定类型的开锁方式列表。

参数

参数类型必填说明
是列表查询入参(type 必填、lockDevId 可选)

返回值

类型:Promise<FitUnlockMethodItem[]>
解析后的开锁方式列表(已剥离 passWord 等敏感字段)
FitUnlockMethodItem
属性类型说明
idnumber云端开锁方式记录 id(来自 `unlockBindingId`)
unlockIdnumber锁端开锁实例 id
unlockNamestring开锁方式名称
photoUnlockboolean是否图片类开锁方式
isSpecialboolean是否特殊开锁方式(配件版不支持,固定 false)
type"finger" | "face" | "password" | "card" | "fingerVein" | "hand" | "eye"开锁方式类型,与入参一致
userNamestring密码所属用户名
lockUserIdnumber用户的锁端用户 id
userTypenumber用户类型
[]可解锁的门锁设备列表

错误码

错误码错误信息
1014当前设备不支持该 type 或缺少对应 DP id

引用对象

interfaceFitUnlockMethodDevice
属性类型描述
devIdstring门锁设备 id
devNamestring门锁设备名称

合法值

GetFitUnlockMethodListParams.type
值说明最低版本
finger--
face--
password--
card--
fingerVein--
hand--
eye--
return.type
值说明最低版本
finger--
face--
password--
card--
fingerVein--
hand--
eye--

示例代码

import { getFitUnlockMethodList } from '@ray-js/lock-sdk';
const list = await getFitUnlockMethodList({ type: 'password' });
const lockOnly = await getFitUnlockMethodList({
  type: 'password',
  lockDevId: 'lock_xxx',
});