From cb8536b77509a38e04594bc57fb93555c048c30b Mon Sep 17 00:00:00 2001
From: vincentlu <t1341870251@gmail.com>
Date: 星期六, 08 二月 2025 15:52:30 +0800
Subject: [PATCH] #
---
rsf-admin/src/page/login/index.jsx | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/rsf-admin/src/page/login/index.jsx b/rsf-admin/src/page/login/index.jsx
index 5c56eaf..765ea27 100644
--- a/rsf-admin/src/page/login/index.jsx
+++ b/rsf-admin/src/page/login/index.jsx
@@ -8,6 +8,8 @@
Typography,
Tabs,
Tab,
+ useTheme,
+ useMediaQuery,
} from '@mui/material';
import {
useTranslate,
@@ -21,9 +23,13 @@
const Index = () => {
const translate = useTranslate();
+ const theme = useTheme();
+ const isSmallScreen = useMediaQuery(theme.breakpoints.down('md'));
const [tab, setTab] = useState(0)
const [tenantList, setTenantList] = useState([]);
+
+ const formPosition = isSmallScreen ? 'middle' : 'right'
useEffect(() => {
tenants().then(data => {
@@ -31,20 +37,20 @@
})
}, []);
+
return (
<Box
sx={{
display: 'flex',
flexDirection: 'column',
minHeight: '100vh',
- alignItems: 'center',
- justifyContent: 'flex-start',
- // justifyContent: 'center',
+ alignItems: formPosition === 'middle' ? 'center' : 'flex-end',
+ paddingRight: formPosition === 'middle' ? 0 : '6em',
+ justifyContent: formPosition === 'middle' ? 'flex-start' : 'center',
background: `url(/login_bg.jpg)`, // https://unsplash.com/
backgroundRepeat: 'no-repeat',
backgroundSize: 'cover',
- }
- }
+ }}
>
<video
autoPlay
@@ -70,13 +76,13 @@
<Card sx={{
width: 400,
- marginTop: '6em',
+ marginTop: formPosition === 'middle' ? '6em' : 0,
zIndex: 1
}}>
<div>
<AppBar position="static" sx={{ backgroundColor: '#3D4BA7' }}>
<Toolbar>
- <Typography variant="h6" color="inherit">Welcome</Typography>
+ <Typography variant="h6" color="inherit">{translate("page.login.title")}</Typography>
</Toolbar>
</AppBar>
</div>
@@ -97,8 +103,8 @@
{tab === 0 && <Login tenantList={tenantList} />}
{tab === 1 && <Register tenantList={tenantList} />}
- <Box mt={1} mb={1} sx={{ textAlign: 'center' }}>
- <Typography variant="caption" align="center">rsf - sever</Typography>
+ <Box mb={1} sx={{ textAlign: 'center' }}>
+ <Typography variant="caption" align="center">{translate("page.login.footer")}</Typography>
</Box>
</Card>
</Box >
--
Gitblit v1.9.1