提供基本前后端骨架

This commit is contained in:
hisatri
2026-01-06 23:49:23 +08:00
parent 84d4ccc226
commit 06f8176e23
89 changed files with 19293 additions and 2 deletions

28
frontend/src/app/page.tsx Normal file
View File

@@ -0,0 +1,28 @@
'use client';
import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useAuthStore } from '@/lib/store';
import { PageLoader } from '@/components/ui';
export default function HomePage() {
const router = useRouter();
const { isAuthenticated, isLoading, fetchUser } = useAuthStore();
useEffect(() => {
fetchUser();
}, [fetchUser]);
useEffect(() => {
if (!isLoading) {
if (isAuthenticated) {
router.replace('/dashboard');
} else {
router.replace('/login');
}
}
}, [isLoading, isAuthenticated, router]);
return <PageLoader />;
}