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