From 8c028e0905a632703c23b0d4e980e55db34c9cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Mon, 2 Sep 2024 10:51:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7=E8=BF=87?= =?UTF-8?q?=E5=A4=9A=EF=BC=8C=E6=B8=85=E7=90=86=E7=94=A8=E6=88=B7=E6=97=B6?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stores/bluetooth.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/stores/bluetooth.js b/stores/bluetooth.js index 5e65a82..a7dc916 100644 --- a/stores/bluetooth.js +++ b/stores/bluetooth.js @@ -297,9 +297,14 @@ export const useBluetoothStore = defineStore('ble', { case cmdIds.addUser: that.updateCurrentLockInfo({ ...that.currentLockInfo, - token: decrypted.slice(42,46), - lockUserNo: decrypted[47] * 256 + decrypted[48] + token: decrypted.slice(42,46) }) + if(decrypted[46] === 0) { + that.updateCurrentLockInfo({ + ...that.currentLockInfo, + lockUserNo: decrypted[47] * 256 + decrypted[48] + }) + } console.log('添加用户结果', decrypted[46], that.currentLockInfo.token) characteristicValueCallback({ code: decrypted[46]