diff --git a/src/features/auth/contexts/AuthContext.jsx b/src/features/auth/contexts/AuthContext.jsx
index b0afd8e..3c53c9c 100644
--- a/src/features/auth/contexts/AuthContext.jsx
+++ b/src/features/auth/contexts/AuthContext.jsx
@@ -5,7 +5,7 @@
   useEffect,
   useCallback,
 } from "react";
-import { userLogin, registerUser, logoutUser } from "@/api/auth";
+import { userLogin, registerUser, logoutUser, adminLogin as adminLoginAPI } from "@/api/auth";
 import { message } from "antd";
 import { useNavigate } from "react-router-dom"; // 导入 useNavigate
 
@@ -88,6 +88,36 @@
     }
   };
 
+  const adminLogin = async (params) => {
+    setLoading(true);
+    try {
+      const response = await adminLoginAPI(params);
+
+      if (response && response.data) {
+        const token = response.data.token;
+        const adminData = response.data;
+        
+        console.log("Saving user data:", adminData);
+        
+        localStorage.setItem("token", token);
+        localStorage.setItem("user", JSON.stringify(adminData));
+        
+        setUser(adminData);
+        setIsAuthenticated(true);
+        
+        message.success(response?.message || "登录成功");
+        return adminData;
+      }
+    } catch (error) {
+      console.log("admin login error", error);
+      setIsAuthenticated(false);
+      setUser(null);
+      message.error(error.message || "管理员登录失败，请检查用户名和密码");
+    } finally {
+      setLoading(false);
+    }
+  };
+
   const register = async (userData) => {
     setLoading(true);
     try {
@@ -134,7 +164,11 @@
 
   const hasRole = useCallback(
     (roleName) => {
-      return user?.role === roleName;
+      if (user?.uid.includes('admin')) {
+        return true;
+      } else {
+        return user?.role === roleName;
+      }
     },
     [user]
   );
@@ -144,6 +178,7 @@
     isAuthenticated,
     loading,
     login,
+    adminLogin,
     register,
     logout,
     hasRole,
