活动发布
All checks were successful
Deploy to Server / deploy (push) Successful in 1m44s

This commit is contained in:
jeremygan2021
2026-03-04 13:07:54 +08:00
parent 96ebd781b9
commit d3dbaaa090
23 changed files with 160 additions and 409 deletions

View File

@@ -7,7 +7,6 @@ const AuthContext = createContext(null);
export const AuthProvider = ({ children }) => {
const [user, setUser] = useState(null);
const [loading, setLoading] = useState(true);
const [loginModalVisible, setLoginModalVisible] = useState(false);
useEffect(() => {
const initAuth = async () => {
@@ -72,11 +71,8 @@ export const AuthProvider = ({ children }) => {
localStorage.setItem('user', JSON.stringify(newUser));
};
const showLoginModal = () => setLoginModalVisible(true);
const hideLoginModal = () => setLoginModalVisible(false);
return (
<AuthContext.Provider value={{ user, login, logout, updateUser, loading, loginModalVisible, showLoginModal, hideLoginModal }}>
<AuthContext.Provider value={{ user, login, logout, updateUser, loading }}>
{children}
</AuthContext.Provider>
);