fix:修复发送注册卡片后不刷卡没有超时的回调
This commit is contained in:
parent
6613ad29d1
commit
5eaadc0e9a
217
common.js
217
common.js
@ -1011,26 +1011,31 @@ export async function parsingCharacteristicValue(binaryData) {
|
||||
case subCmdIds.registerCardConfirm:
|
||||
// 收到锁版回复判断操作类型进行对应api操作
|
||||
if (decrypted[2] === Result.Success.code) {
|
||||
switch (this.requestParams.operate) {
|
||||
case 0:
|
||||
// 注册
|
||||
const addResult = await addIcCardRequest({
|
||||
...this.requestParams,
|
||||
isCoerced: this.requestParams.isForce,
|
||||
cardRight: this.requestParams.isAdmin,
|
||||
lockId: this.lockInfo.lockId,
|
||||
cardNumber: decrypted[6] * 256 + decrypted[7],
|
||||
cardUserNo: this.requestParams.cardUserNo
|
||||
})
|
||||
if (addResult.code === Result.Success.code) {
|
||||
// 增加返回一个卡序号
|
||||
addResult.data.cardNumber = decrypted[6] * 256 + decrypted[7];
|
||||
}
|
||||
// 触发卡片确认事件
|
||||
emitRegisterCardConfirmEvent(addResult)
|
||||
// 断开蓝牙连接
|
||||
await this.disconnectDevice()
|
||||
break;
|
||||
if (decrypted[5] === Result.Success.code) {
|
||||
switch (this.requestParams.operate) {
|
||||
case 0:
|
||||
// 注册
|
||||
const addResult = await addIcCardRequest({
|
||||
...this.requestParams,
|
||||
isCoerced: this.requestParams.isForce,
|
||||
cardRight: this.requestParams.isAdmin,
|
||||
lockId: this.lockInfo.lockId,
|
||||
cardNumber: decrypted[6] * 256 + decrypted[7],
|
||||
cardUserNo: this.requestParams.cardUserNo
|
||||
})
|
||||
if (addResult.code === Result.Success.code) {
|
||||
// 增加返回一个卡序号
|
||||
addResult.data.cardNumber = decrypted[6] * 256 + decrypted[7];
|
||||
}
|
||||
// 触发卡片确认事件
|
||||
emitRegisterCardConfirmEvent(addResult)
|
||||
// 断开蓝牙连接
|
||||
await this.disconnectDevice()
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
emitRegisterCardConfirmEvent(new Result(Result.Fail.code, null, decrypted[5]))
|
||||
this.characteristicValueCallback(new Result(decrypted[5]))
|
||||
}
|
||||
} else {
|
||||
emitRegisterCardConfirmEvent(new Result(Result.Fail.code, null, decrypted[2]))
|
||||
@ -1092,24 +1097,34 @@ export async function parsingCharacteristicValue(binaryData) {
|
||||
break;
|
||||
case subCmdIds.registerFingerprintConfirm:
|
||||
if (decrypted[2] === Result.Success.code) {
|
||||
if (this.requestParams.operate === 0) {
|
||||
const addResult = await addFingerprintRequest({
|
||||
...this.requestParams,
|
||||
isCoerced: this.requestParams.isForce,
|
||||
fingerRight: this.requestParams.isAdmin,
|
||||
lockId: this.lockInfo.lockId,
|
||||
fingerprintNumber: decrypted[6] * 256 + decrypted[7],
|
||||
fingerprintUserNo: this.requestParams.fingerprintUserNo
|
||||
})
|
||||
if (addResult.code === Result.Success.code) {
|
||||
// 增加返回一个指纹序号
|
||||
addResult.data.fingerprintNumber = decrypted[6] * 256 + decrypted[7];
|
||||
if (decrypted[5] === Result.Success.code) {
|
||||
if (this.requestParams.operate === 0) {
|
||||
switch (this.requestParams.operate) {
|
||||
case 0:
|
||||
const addResult = await addFingerprintRequest({
|
||||
...this.requestParams,
|
||||
isCoerced: this.requestParams.isForce,
|
||||
fingerRight: this.requestParams.isAdmin,
|
||||
lockId: this.lockInfo.lockId,
|
||||
fingerprintNumber: decrypted[6] * 256 + decrypted[7],
|
||||
fingerprintUserNo: this.requestParams.fingerprintUserNo
|
||||
})
|
||||
if (addResult.code === Result.Success.code) {
|
||||
// 增加返回一个指纹序号
|
||||
addResult.data.fingerprintNumber = decrypted[6] * 256 + decrypted[7];
|
||||
}
|
||||
// 触发指纹确认事件
|
||||
emitRegisterFingerprintConfirmEvent(addResult)
|
||||
// 断开蓝牙连接
|
||||
await this.disconnectDevice()
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 触发指纹确认事件
|
||||
emitRegisterFingerprintConfirmEvent(addResult)
|
||||
// 断开蓝牙连接
|
||||
await this.disconnectDevice()
|
||||
} else {
|
||||
emitRegisterCardConfirmEvent(new Result(Result.Fail.code, null, decrypted[5]))
|
||||
this.characteristicValueCallback(new Result(decrypted[5]))
|
||||
}
|
||||
|
||||
} else {
|
||||
emitRegisterCardConfirmEvent(new Result(Result.Fail.code, null, decrypted[2]))
|
||||
this.characteristicValueCallback(new Result(decrypted[2]))
|
||||
@ -1168,22 +1183,31 @@ export async function parsingCharacteristicValue(binaryData) {
|
||||
break;
|
||||
case subCmdIds.registerFaceConfirm:
|
||||
if (this.requestParams.operate === 0) {
|
||||
const addResult = await addFaceRequest({
|
||||
...this.requestParams,
|
||||
isCoerced: this.requestParams.isForce,
|
||||
fingerRight: this.requestParams.isAdmin,
|
||||
lockId: this.lockInfo.lockId,
|
||||
faceNumber: decrypted[6] * 256 + decrypted[7],
|
||||
faceUserNo: this.requestParams.faceUserNo
|
||||
})
|
||||
if (addResult.code === Result.Success.code) {
|
||||
// 增加返回一个序号
|
||||
addResult.data.faceNumber = decrypted[6] * 256 + decrypted[7];
|
||||
if (decrypted[5] === Result.Success.code) {
|
||||
switch (this.requestParams.operate) {
|
||||
case 0:
|
||||
const addResult = await addFaceRequest({
|
||||
...this.requestParams,
|
||||
isCoerced: this.requestParams.isForce,
|
||||
fingerRight: this.requestParams.isAdmin,
|
||||
lockId: this.lockInfo.lockId,
|
||||
faceNumber: decrypted[6] * 256 + decrypted[7],
|
||||
faceUserNo: this.requestParams.faceUserNo
|
||||
})
|
||||
if (addResult.code === Result.Success.code) {
|
||||
// 增加返回一个序号
|
||||
addResult.data.faceNumber = decrypted[6] * 256 + decrypted[7];
|
||||
}
|
||||
// 触发事件
|
||||
emitRegisterFaceConfirmEvent(addResult)
|
||||
// 断开蓝牙连接
|
||||
await this.disconnectDevice()
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
emitRegisterCardConfirmEvent(new Result(Result.Fail.code, null, decrypted[5]))
|
||||
this.characteristicValueCallback(new Result(decrypted[5]))
|
||||
}
|
||||
// 触发事件
|
||||
emitRegisterFaceConfirmEvent(addResult)
|
||||
// 断开蓝牙连接
|
||||
await this.disconnectDevice()
|
||||
} else {
|
||||
emitRegisterCardConfirmEvent(new Result(Result.Fail.code, null, decrypted[2]))
|
||||
this.characteristicValueCallback(new Result(decrypted[2]))
|
||||
@ -1235,26 +1259,31 @@ export async function parsingCharacteristicValue(binaryData) {
|
||||
case subCmdIds.registerPalmVeinConfirm:
|
||||
// 收到锁版回复判断操作类型进行对应api操作
|
||||
if (decrypted[2] === Result.Success.code) {
|
||||
switch (this.requestParams.operate) {
|
||||
case 0:
|
||||
// 注册
|
||||
const addResult = await addPalmVeinRequest({
|
||||
...this.requestParams,
|
||||
isCoerced: this.requestParams.isForce,
|
||||
palmVeinRight: this.requestParams.isAdmin,
|
||||
lockId: this.lockInfo.lockId,
|
||||
palmVeinNumber: decrypted[6] * 256 + decrypted[7],
|
||||
palmVeinUserNo: this.requestParams.palmVeinUserNo
|
||||
})
|
||||
if (addResult.code === Result.Success.code) {
|
||||
// 增加返回一个卡序号
|
||||
addResult.data.palmVeinNumber = decrypted[6] * 256 + decrypted[7];
|
||||
}
|
||||
// 触发卡片确认事件
|
||||
emitRegisterPalmVeinConfirmEvent(addResult)
|
||||
// 断开蓝牙连接
|
||||
await this.disconnectDevice()
|
||||
break;
|
||||
if (decrypted[5] === Result.Success.code) {
|
||||
switch (this.requestParams.operate) {
|
||||
case 0:
|
||||
// 注册
|
||||
const addResult = await addPalmVeinRequest({
|
||||
...this.requestParams,
|
||||
isCoerced: this.requestParams.isForce,
|
||||
palmVeinRight: this.requestParams.isAdmin,
|
||||
lockId: this.lockInfo.lockId,
|
||||
palmVeinNumber: decrypted[6] * 256 + decrypted[7],
|
||||
palmVeinUserNo: this.requestParams.palmVeinUserNo
|
||||
})
|
||||
if (addResult.code === Result.Success.code) {
|
||||
// 增加返回一个卡序号
|
||||
addResult.data.palmVeinNumber = decrypted[6] * 256 + decrypted[7];
|
||||
}
|
||||
// 触发卡片确认事件
|
||||
emitRegisterPalmVeinConfirmEvent(addResult)
|
||||
// 断开蓝牙连接
|
||||
await this.disconnectDevice()
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
emitRegisterCardConfirmEvent(new Result(Result.Fail.code, null, decrypted[5]))
|
||||
this.characteristicValueCallback(new Result(decrypted[5]))
|
||||
}
|
||||
} else {
|
||||
emitRegisterCardConfirmEvent(new Result(Result.Fail.code, null, decrypted[2]))
|
||||
@ -1305,27 +1334,33 @@ export async function parsingCharacteristicValue(binaryData) {
|
||||
case subCmdIds.registerRemoteConfirm:
|
||||
// 收到锁版回复判断操作类型进行对应api操作
|
||||
if (decrypted[2] === Result.Success.code) {
|
||||
switch (this.requestParams.operate) {
|
||||
case 0:
|
||||
// 注册
|
||||
const addResult = await addRemoteRequest({
|
||||
...this.requestParams,
|
||||
isCoerced: this.requestParams.isForce,
|
||||
remoteRight: this.requestParams.isAdmin,
|
||||
lockId: this.lockInfo.lockId,
|
||||
remoteNumber: decrypted[6] * 256 + decrypted[7],
|
||||
remoteUserNo: this.requestParams.remoteUserNo
|
||||
})
|
||||
if (addResult.code === Result.Success.code) {
|
||||
// 增加返回一个卡序号
|
||||
addResult.data.remoteNumber = decrypted[6] * 256 + decrypted[7];
|
||||
}
|
||||
// 触发卡片确认事件
|
||||
emitRegisterRemoteConfirmEvent(addResult)
|
||||
// 断开蓝牙连接
|
||||
await this.disconnectDevice()
|
||||
break;
|
||||
if (decrypted[5] === Result.Success.code) {
|
||||
switch (this.requestParams.operate) {
|
||||
case 0:
|
||||
// 注册
|
||||
const addResult = await addRemoteRequest({
|
||||
...this.requestParams,
|
||||
isCoerced: this.requestParams.isForce,
|
||||
remoteRight: this.requestParams.isAdmin,
|
||||
lockId: this.lockInfo.lockId,
|
||||
remoteNumber: decrypted[6] * 256 + decrypted[7],
|
||||
remoteUserNo: this.requestParams.remoteUserNo
|
||||
})
|
||||
if (addResult.code === Result.Success.code) {
|
||||
// 增加返回一个卡序号
|
||||
addResult.data.remoteNumber = decrypted[6] * 256 + decrypted[7];
|
||||
}
|
||||
// 触发卡片确认事件
|
||||
emitRegisterRemoteConfirmEvent(addResult)
|
||||
// 断开蓝牙连接
|
||||
await this.disconnectDevice()
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
emitRegisterCardConfirmEvent(new Result(Result.Fail.code, null, decrypted[5]))
|
||||
this.characteristicValueCallback(new Result(decrypted[5]))
|
||||
}
|
||||
|
||||
} else {
|
||||
emitRegisterCardConfirmEvent(new Result(Result.Fail.code, null, decrypted[2]))
|
||||
this.characteristicValueCallback(new Result(decrypted[2]))
|
||||
|
||||
4
env.js
4
env.js
@ -1,7 +1,7 @@
|
||||
// uni版本号
|
||||
export const uniVersion = '1.0.17'
|
||||
export const uniVersion = '1.0.18'
|
||||
// uni构建号
|
||||
export const uniBuildNumber = 18
|
||||
export const uniBuildNumber = 19
|
||||
|
||||
// web版本号
|
||||
export const webVersion = '1.0.1'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "star-cloud-uni",
|
||||
"version": "1.0.15",
|
||||
"version": "1.0.18",
|
||||
"type": "module",
|
||||
"main": "./uni/index.js",
|
||||
"author": "zzc059",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user