From 5eb9ee79f8a2f9ca7c14d3a53cf9a72e9272288c Mon Sep 17 00:00:00 2001 From: LiLongLong <13717757313@163.com> Date: Tue, 11 Mar 2025 09:26:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=BE=E5=A4=87=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Header.tsx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/components/Header.tsx b/src/components/Header.tsx index e6a24fd..85358b4 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -20,15 +20,9 @@ export default function Header() { const deviceState = useAppSelector(store => store.deviceState); const userInfo = useAppSelector(store => store.context.user.loginUser); let [isConnect, setIsConnect] = useState(deviceState.isConnect); - - const [bluetoothInfo, setBluetoothInfo] = useState(deviceState); - useEffect(()=>{ - setBluetoothInfo(deviceState) - },[deviceState]) //获取当前websocet的状态 const showBlueImg = () => { - console.log('deviceState---', deviceState) - if (isConnect) { + if (deviceState.isConnect) { return (
@@ -128,17 +122,16 @@ export default function Header() { //设备已连接 const getBtContent = () => { - console.log('bluetoothInfo---22----', bluetoothInfo) return ( -
+
设备已连接
-
sn码:{bluetoothInfo.sn}
-
设备描述:{bluetoothInfo.descriptivePortName}
+
sn码:{deviceState.sn}
+
设备描述:{deviceState.descriptivePortName}
{/*
电量:{bluetoothInfo.power}
*/}