From d9995fab5fd7899aa64fee9ec2b4c05c999c5622 Mon Sep 17 00:00:00 2001 From: wood chen Date: Mon, 16 Jun 2025 09:54:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Vite=20=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=20API=20=E4=BB=A3=E7=90=86=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=EF=BC=8C=E6=94=B9=E4=B8=BA=E4=BD=BF=E7=94=A8=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E3=80=82=E5=90=8C=E6=97=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20App=20=E7=BB=84=E4=BB=B6=E7=9A=84=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E5=B1=82=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A7=BB=E9=99=A4=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E7=9A=84=E8=83=8C=E6=99=AF=E5=9B=BE=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E7=AE=80=E5=8C=96=E4=BB=A3=E7=A0=81=E7=BB=93?= =?UTF-8?q?=E6=9E=84=EF=BC=8C=E6=8F=90=E5=8D=87=E7=94=A8=E6=88=B7=E4=BD=93?= =?UTF-8?q?=E9=AA=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 47 +++++++++++++++++------------------------------ 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 02a5fda..0f8dffe 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -6,11 +6,9 @@ import { DashCommand } from "./components/DashCommand" import ErrorBoundary from "./components/ErrorBoundary" import Footer from "./components/Footer" import Header, { RefreshToast } from "./components/Header" -import { useBackground } from "./hooks/use-background" import { useTheme } from "./hooks/use-theme" import { InjectContext } from "./lib/inject" import { fetchSetting } from "./lib/nezha-api" -import { cn } from "./lib/utils" import ErrorPage from "./pages/ErrorPage" import NotFound from "./pages/NotFound" import Server from "./pages/Server" @@ -25,7 +23,6 @@ const App: React.FC = () => { }) const { setTheme } = useTheme() const [isCustomCodeInjected, setIsCustomCodeInjected] = useState(false) - const { backgroundImage: customBackgroundImage } = useBackground() useEffect(() => { if (settingData?.data?.config?.custom_code) { @@ -57,41 +54,31 @@ const App: React.FC = () => { return null } - const customMobileBackgroundImage = window.CustomMobileBackgroundImage !== "" ? window.CustomMobileBackgroundImage : undefined - return ( - {/* 固定定位的背景层 */} - {customBackgroundImage && ( +
+ {/* 固定定位的背景层 */}
- )} - {customMobileBackgroundImage && ( -
- )} -
-
+ +
- - } /> - } /> - } /> - } /> - +
+ + } /> + } /> + } /> + } /> + +