diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index 8a4ec698..2e1f4c88 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -64,6 +64,16 @@ export default function (props: any) { } }, [props.location.pathname]); + useEffect(() => { + if (theme && theme.theme) { + if (theme.theme === 'vs-dark') { + document.body.classList.add('dark'); + } else { + document.body.classList.add('white'); + } + } + }, [theme]); + useEffect(() => { const _theme = localStorage.getItem('qinglong_dark_theme') || 'auto'; setFetchMethod(window.fetch); @@ -92,7 +102,6 @@ export default function (props: any) { 控制面板