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}
*/}