diff --git a/src/pages/login/index.module.scss b/src/pages/login/index.module.scss index 659944e..d8bacd7 100644 --- a/src/pages/login/index.module.scss +++ b/src/pages/login/index.module.scss @@ -1,10 +1,8 @@ .login-content { - position: absolute; - bottom: 0; - left: 0; - right: 0; - top: 0; + position: fixed; + width: 100%; background-image: url("../../assets//images/login/bg.png"); + background-repeat: no-repeat; background-size: 100% 100%; .top-content { width: 100%; diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index 5c44b66..4ce6045 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -22,10 +22,13 @@ const LoginPage = () => { const [captchaVal, setCaptchaVal] = useState(""); const [captchaKey, setCaptchaKey] = useState(""); const [captchaLoading, setCaptchaLoading] = useState(true); + const [bodyHeight, setBodyHeight] = useState(0); useEffect(() => { fetchImageCaptcha(); document.title = "登录"; + let value = document.documentElement.clientHeight; + setBodyHeight(value); }, []); const fetchImageCaptcha = () => { @@ -123,7 +126,10 @@ const LoginPage = () => { }; return ( -
+
学员登录