登录页面优化

This commit is contained in:
禺狨 2023-06-30 16:31:00 +08:00
parent 6bc0e443be
commit 8ba02aaaed
2 changed files with 10 additions and 6 deletions

View File

@ -1,10 +1,8 @@
.login-content { .login-content {
position: absolute; position: fixed;
bottom: 0; width: 100%;
left: 0;
right: 0;
top: 0;
background-image: url("../../assets//images/login/bg.png"); background-image: url("../../assets//images/login/bg.png");
background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
.top-content { .top-content {
width: 100%; width: 100%;

View File

@ -22,10 +22,13 @@ const LoginPage = () => {
const [captchaVal, setCaptchaVal] = useState<string>(""); const [captchaVal, setCaptchaVal] = useState<string>("");
const [captchaKey, setCaptchaKey] = useState<string>(""); const [captchaKey, setCaptchaKey] = useState<string>("");
const [captchaLoading, setCaptchaLoading] = useState(true); const [captchaLoading, setCaptchaLoading] = useState(true);
const [bodyHeight, setBodyHeight] = useState<number>(0);
useEffect(() => { useEffect(() => {
fetchImageCaptcha(); fetchImageCaptcha();
document.title = "登录"; document.title = "登录";
let value = document.documentElement.clientHeight;
setBodyHeight(value);
}, []); }, []);
const fetchImageCaptcha = () => { const fetchImageCaptcha = () => {
@ -123,7 +126,10 @@ const LoginPage = () => {
}; };
return ( return (
<div className={styles["login-content"]}> <div
className={styles["login-content"]}
style={{ height: bodyHeight + "px" }}
>
<div className={styles["top-content"]}> <div className={styles["top-content"]}>
<div className={styles["title"]}></div> <div className={styles["title"]}></div>
<Image src={banner} width={150} height={150} /> <Image src={banner} width={150} height={150} />