feat: 1. SDK添加获取锁支持功能 2. 修改获取离线密码入参
This commit is contained in:
parent
19fb63c857
commit
51d225af4c
@ -166,4 +166,13 @@ const data = await $starCloud.syncAllOpenRecord(params)
|
||||
* @returns {Promise<Result>}
|
||||
*/
|
||||
const data = await $starCloud.getServerTimestamp()
|
||||
|
||||
/**
|
||||
* 获取锁支持项
|
||||
* @param params
|
||||
* @param {AccountInfo} params.accountInfo 账号信息
|
||||
* @param {Number} params.lockId 锁 Id
|
||||
* @returns {Promise<Result>}
|
||||
*/
|
||||
const data = await $starCloud.getLockSupportFeatures(params)
|
||||
```
|
||||
|
||||
9
api.js
9
api.js
@ -161,3 +161,12 @@ export function uploadRecordRequest(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取锁应用设置
|
||||
export function getLockSettingDataRequest(data) {
|
||||
return request({
|
||||
url: '/v1/lock/getLockSettingData',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
33
starCloud.js
33
starCloud.js
@ -10,6 +10,7 @@ import {
|
||||
getLastRecordTimeRequest,
|
||||
getLockDetailRequest,
|
||||
getLockNetTokenRequest,
|
||||
getLockSettingDataRequest,
|
||||
getOfflinePasswordRequest,
|
||||
getServerDatetimeRequest,
|
||||
getStarCloudToken,
|
||||
@ -51,6 +52,7 @@ import log from '@/starCloud/log'
|
||||
* @typedef {Object} OfflinePassword
|
||||
* @property {String} keyboardPwdName - 密码名称
|
||||
* @property {Number} keyboardPwdType - 密码类型
|
||||
* @property {Number} lockId - 锁 Id
|
||||
* @property {Number} isCoerced - 胁迫 1:胁迫 2:非胁迫
|
||||
* @property {Number} startDate - 开始时间
|
||||
* @property {Number} endDate - 结束时间
|
||||
@ -532,10 +534,7 @@ export const useStarCloudStore = defineStore('starCloud', {
|
||||
if (result.code !== Result.Success.code) {
|
||||
return result
|
||||
}
|
||||
return await getOfflinePasswordRequest({
|
||||
...password,
|
||||
lockId: this.lockInfo.lockId
|
||||
})
|
||||
return await getOfflinePasswordRequest(password)
|
||||
},
|
||||
/**
|
||||
* 自定义密码
|
||||
@ -1164,6 +1163,32 @@ export const useStarCloudStore = defineStore('starCloud', {
|
||||
return new Result(code, data, message)
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取锁支持项
|
||||
* @param params
|
||||
* @param {AccountInfo} params.accountInfo 账号信息
|
||||
* @param {Number} params.lockId 锁 Id
|
||||
* @returns {Promise<Result>}
|
||||
*/
|
||||
async getLockSupportFeatures(params) {
|
||||
const { accountInfo, lockId } = params
|
||||
|
||||
// 设置执行账号
|
||||
const result = await this.login(accountInfo)
|
||||
if (result.code !== Result.Success.code) {
|
||||
return result
|
||||
}
|
||||
|
||||
const { code, data, message } = await getLockSettingDataRequest({
|
||||
lockId: lockId
|
||||
})
|
||||
if (code === Result.Success.code) {
|
||||
return new Result(code, { ...data.lockFeature }, message)
|
||||
} else {
|
||||
return new Result(code, data, message)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 清理用户
|
||||
* @returns {Promise<Result>}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user