- replace isLoading with isFetching to align with React Query v4+ API conventions - maintain same loading state functionality while using correct query status property
@@ -49,7 +49,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
};
// 使用useQuery检查登录状态
- const { isLoading } = useQuery({
+ const { isFetching: isLoading } = useQuery({
queryKey: ['auth', 'status', token],
queryFn: async () => {
if (!token) {