diff --git a/src/views/login/login.tsx b/src/views/login/login.tsx
index bd429c7..562f178 100644
--- a/src/views/login/login.tsx
+++ b/src/views/login/login.tsx
@@ -11,38 +11,39 @@
 import logo from '&/assets/logo.png';
 import { getUserInfo } from '@/api/user';
 import debounce from 'lodash/debounce';
+import {message} from 'antd';
+
 
 const Login: React.FC = () => {
     const [email, setEmail] = useState('');
     const [password, setPassword] = useState('');
     const dispatch = useAppDispatch();
-    const { refresh: postUserLoginRefresh } = useApi(() => request.post(postUserLogin, {}), false);
+    const { refresh: postUserLoginRefresh } = useApi(() => request.post(postUserLogin, {email, password}), false);
     const { refresh: getUserInfoRefresh } = useApi(() => request.get(getUserInfo), false);
+    const [messageApi, contextHolder] = message.useMessage();
 
     const nav = useNavigate();
+    const showErrorMessage = async (message: string) => {
+        messageApi.error(message);
+    };
     const handleLogin = debounce(async () => {
         try {
-            const res =await postUserLoginRefresh();
-            if (res==null ||(res as any).error) {
-                alert('Login failed. Please check your credentials.');
-                return;
+            const res = await postUserLoginRefresh();
+            console.log(res);
+            if (res == null || (res as any).error) {
+                throw new Error('登录失败');
             }
             dispatch({ type: "user/login", payload: res });
-            
+
             const userInfo = await getUserInfoRefresh();
-            if (userInfo==null || (userInfo as any).error) {
-                alert('Failed to fetch user information.');
-                return;
+            if (userInfo == null || (userInfo as any).error) {
+                throw new Error('获取用户信息失败');
             }
             dispatch({ type: "user/getUserInfo", payload: userInfo });
             nav('/');
         } catch (error) {
-            alert('An unexpected error occurred. Please try again later.');
-            if (error instanceof Error) {
-              console.error(error.message); // 明确访问 message 属性
-            } else {
-              console.error('Unknown error occurred');
-            }
+            // 将错误信息传递给一个异步函数
+            showErrorMessage('登录失败，请检查您的用户名和密码');
         }
     }, 1000) as () => void;
 
@@ -51,6 +52,7 @@
     }
     return (
         <div className={style.form}>
+            {contextHolder}
             <img className={style.logo} src={logo} alt="logo" onClick={handleLogoClick}></img>
             <input type="email" value={email} onChange={(e) => setEmail(e.target.value)} className={style.email} placeholder="Enter your email" />
             <input type="password" value={password} onChange={(e) => setPassword(e.target.value)} className={style.password} placeholder="Enter your password" />
