import React, { useEffect } from 'react'; import { useAuthStore } from '@/store/authStore'; interface AuthProviderProps { children: React.ReactNode; } export const AuthProvider: React.FC = ({ children }) => { const initAuth = useAuthStore(state => state.initAuth); useEffect(() => { // 在应用启动时初始化认证状态 initAuth(); }, [initAuth]); return <>{children}; };