Initial commit: restore project after Git corruption
This commit is contained in:
17
web/src/apps/login/AuthProvider.tsx
Normal file
17
web/src/apps/login/AuthProvider.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { useAuthStore } from '@/store/authStore';
|
||||
|
||||
interface AuthProviderProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
|
||||
const initAuth = useAuthStore(state => state.initAuth);
|
||||
|
||||
useEffect(() => {
|
||||
// 在应用启动时初始化认证状态
|
||||
initAuth();
|
||||
}, [initAuth]);
|
||||
|
||||
return <>{children}</>;
|
||||
};
|
||||
Reference in New Issue
Block a user