From 7afaf80981b12906494bb3cf70831b6fab62bf00 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Thu, 17 Apr 2025 18:41:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=B3=BB=E7=BB=9F=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 23 +++------ src/pages/system/Setting.tsx | 112 +++++++++++++++------------------------- src/store/system/systemSlice.ts | 51 ++++++++---------- 3 files changed, 70 insertions(+), 116 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index fe70ad1..e3e661d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from "react"; import "./App.scss"; -import { Outlet, useNavigate, useLocation } from "react-router"; +import { Outlet, useNavigate } from "react-router"; import { Layout, ConfigProvider, message} from "antd"; import { default as AppHeader } from "./components/Header"; import { default as AppFooter } from "./components/Footer"; @@ -15,22 +15,15 @@ import { updateDevice } from "./store/features/contextSlice"; import { getStatus, update } from "./services/ktj/org"; import SyncData from "./components/syncData"; import { sysSet } from "./services/user/system"; -import { - updateSystemAccountState, - updateSystemAllState, - updateSystemOrgState, - updateUploadServerUrlState -} from "./store/system/systemSlice"; +import { updateSystemAccountState, updateSystemAllState, updateSystemOrgState } from "./store/system/systemSlice"; import { system } from "./types"; -import Home from "./home"; const { Header, Footer, Sider, Content } = Layout; function App() { const dispatch = useAppDispatch(); const navigate = useNavigate(); - const location = useLocation(); - const isRootRoute = location.pathname === '/'; + useEffect(() => { //连接websocket const wsClient = createWebSocket(sharedWsUrl); @@ -80,7 +73,7 @@ function App() { },[]) useEffect(() => { - + if (localStorage.getItem("user")) { // navigate("/measure/action", { replace: true }); } else { @@ -97,7 +90,7 @@ function App() { }) } - + const querySystemInfo = () => { sysSet({}, "GET").then(res=>{ if(res.status === 0 && res.data && res.data.length){ @@ -110,11 +103,8 @@ function App() { if(item.code === 'UPLOAD_USERNAME'){ dispatch(updateSystemAccountState(item)) } - if(item.code === 'UPLOAD_SERVER_URL'){ - dispatch(updateUploadServerUrlState(item)) - } }) - + } }) } @@ -149,7 +139,6 @@ function App() { - {/* {isRootRoute && } */}