diff --git a/public/logo192.png b/public/logo192.png deleted file mode 100644 index fc44b0a..0000000 Binary files a/public/logo192.png and /dev/null differ diff --git a/public/logo512.png b/public/logo512.png deleted file mode 100644 index a4e47a6..0000000 Binary files a/public/logo512.png and /dev/null differ diff --git a/public/manifest.json b/public/manifest.json index 080d6c7..1f2f141 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -6,16 +6,6 @@ "src": "favicon.ico", "sizes": "64x64 32x32 24x24 16x16", "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" } ], "start_url": ".", diff --git a/src/components/Header.tsx b/src/components/Header.tsx index da6dc4c..7120404 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -19,8 +19,10 @@ export default function Header() { const dispatch = useAppDispatch(); const deviceInfo = useAppSelector(store => store.context.device); const deviceState = useAppSelector(store => store.deviceState); + const userInfo = useAppSelector(store => store.context.user.loginUser); let [isConnect, setIsConnect] = useState(true); const [bluetoothInfo, setBluetoothInfo] = useState(deviceState); + //获取当前websocet的状态 const showBlueImg = () => { if (isConnect) { @@ -58,13 +60,8 @@ export default function Header() { let [bluetoothList, setbluetoothList] = useState(list); //获取mock数据 useEffect(() => { - // getDeviceInfo().then(res => { - // console.log('res===', res) - // //@ts-ignore - // setbluetoothList(res.data.list) - // }) - if (context.user.loginUser && context.user.loginUser.nickName) { - setNickname(context.user.loginUser.nickName); + if (userInfo.nickname) { + setNickname(userInfo.nickname); } else { const user = localStorage.getItem("user"); if (user) { @@ -72,12 +69,10 @@ export default function Header() { setNickname(userData.nickname); } } - }); + },[userInfo.nickname]); - //@ts-ignore - const context = useSelector(store => store.context); const [messageApi, contextHolder] = message.useMessage(); - const [nickname, setNickname] = useState(); + const [nickname, setNickname] = useState(); const items: MenuProps["items"] = [ // { // key: "1",