diff --git a/app/admin_home/page.tsx b/app/admin_home/page.tsx
index 00891cb..5ad6d83 100644
--- a/app/admin_home/page.tsx
+++ b/app/admin_home/page.tsx
@@ -266,7 +266,14 @@ export default function AdminHomePage() {
{/* 로그아웃 */}
-
+
+
+
{/* 메인 콘텐츠 */}
diff --git a/app/admin_lecture1/page.tsx b/app/admin_lecture1/page.tsx
index ee2e16f..25f3004 100644
--- a/app/admin_lecture1/page.tsx
+++ b/app/admin_lecture1/page.tsx
@@ -349,7 +349,14 @@ export default function AdminLecture1Page() {
{/* 로그아웃 */}
-
+
{
+ localStorage.removeItem('isLoggedIn');
+ localStorage.removeItem('isAdminLoggedIn');
+ router.push('/login');
+ }}
+ className="content-stretch flex gap-[9px] h-[36px] items-center relative shrink-0 cursor-pointer hover:opacity-80 transition-opacity"
+ >
@@ -357,21 +364,12 @@ export default function AdminLecture1Page() {
- {
- localStorage.removeItem('isLoggedIn');
- localStorage.removeItem('isAdminLoggedIn');
- router.push('/');
- }}
- className="content-stretch flex h-[36px] items-center justify-between relative shrink-0 w-[76px] cursor-pointer hover:opacity-80 transition-opacity"
- >
-
-
-
+
+
{/* 메인 콘텐츠 */}
diff --git a/app/admin_lecture2/page.tsx b/app/admin_lecture2/page.tsx
index eed8cc7..f2de6d7 100644
--- a/app/admin_lecture2/page.tsx
+++ b/app/admin_lecture2/page.tsx
@@ -263,7 +263,14 @@ export default function AdminLecture2Page() {
{/* 로그아웃 */}
-
+
{
+ localStorage.removeItem('isLoggedIn');
+ localStorage.removeItem('isAdminLoggedIn');
+ router.push('/login');
+ }}
+ className="content-stretch flex gap-[9px] h-[36px] items-center relative shrink-0 cursor-pointer hover:opacity-80 transition-opacity"
+ >
@@ -271,21 +278,12 @@ export default function AdminLecture2Page() {
- {
- localStorage.removeItem('isLoggedIn');
- localStorage.removeItem('isAdminLoggedIn');
- router.push('/');
- }}
- className="content-stretch flex h-[36px] items-center justify-between relative shrink-0 w-[76px] cursor-pointer hover:opacity-80 transition-opacity"
- >
-
-
-
+
+
{/* 메인 콘텐츠 */}
diff --git a/app/page.tsx b/app/page.tsx
index 5cefb04..2233db6 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -6,7 +6,6 @@ import Image from 'next/image';
import { isAdminLoggedIn } from '../lib/auth';
import LoginPage from './login/page';
import Header from './components/Header';
-import Logout from '../public/svg/logout';
const imgImage2 = "http://localhost:3845/assets/89fda8e949171025b1232bae70fc9d442e4e70c8.png";
const imgImage7 = "http://localhost:3845/assets/a4e4d09643b890b56084560cc24d6e532a03487b.png";
@@ -21,7 +20,6 @@ export default function HomePage() {
const [isAdmin, setIsAdmin] = useState(false);
const [isLoading, setIsLoading] = useState(true);
const [currentHeroSlide, setCurrentHeroSlide] = useState(0);
- const [selectedTab, setSelectedTab] = useState<'전체' | '학습자' | '강사' | '운영자'>('전체');
// 임시 데이터 - 실제로는 API에서 가져올 데이터
const [courses, setCourses] = useState([
@@ -61,7 +59,12 @@ export default function HomePage() {
setIsLoggedIn(loginStatus);
setIsAdmin(adminStatus);
setIsLoading(false);
- }, []);
+
+ // 관리자일 경우 admin_home 페이지로 리다이렉트
+ if (adminStatus) {
+ router.push('/admin_home');
+ }
+ }, [router]);
if (isLoading) {
return null; // 로딩 중
@@ -72,222 +75,9 @@ export default function HomePage() {
return ;
}
- // 관리자일 경우 권한 설정 페이지 표시
+ // 관리자일 경우 리다이렉트 중
if (isAdmin) {
- return (
-
- {/* 사이드바 */}
-
- {/* 로고 */}
-
router.push('/')}
- className="h-[102px] relative shrink-0 w-[99px] cursor-pointer hover:opacity-80 transition-opacity"
- >
-
-

-
-
- {/* 메뉴 */}
-
-
-
router.push('/admin_home')}
- className="bg-[#f7f7f7] box-border content-stretch flex gap-2 h-[34px] items-center pl-2 pr-2 py-1 relative rounded-lg shrink-0 w-[226px] cursor-pointer"
- >
-
-
-
router.push('/admin_lecture1')}
- className="box-border content-stretch flex gap-2 h-[34px] items-center pl-2 pr-2 py-1 relative rounded-lg shrink-0 w-[226px] cursor-pointer hover:bg-gray-50 transition-colors"
- >
-
-
-
router.push('/admin_lecture2')}
- className="box-border content-stretch flex gap-2 h-[34px] items-center pl-2 pr-2 py-1 relative rounded-lg shrink-0 w-[226px] cursor-pointer hover:bg-gray-50 transition-colors"
- >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {/* 로그아웃 */}
-
-
-
{
- localStorage.removeItem('isLoggedIn');
- localStorage.removeItem('isAdminLoggedIn');
- router.push('/');
- }}
- className="content-stretch flex h-[36px] items-center justify-between relative shrink-0 w-[76px] cursor-pointer hover:opacity-80 transition-opacity"
- >
-
-
-
-
-
- {/* 메인 콘텐츠 */}
-
- {/* 페이지 타이틀 탭 */}
-
-
setSelectedTab('전체')}
- className={`border-b-[2px] border-solid box-border content-stretch flex gap-[150px] items-center relative shrink-0 ${selectedTab === '전체' ? 'border-[#2b82e8]' : 'border-transparent'}`}
- >
-
-
-
setSelectedTab('학습자')}
- className={`border-b-[2px] border-solid box-border content-stretch flex gap-[150px] items-center relative shrink-0 ${selectedTab === '학습자' ? 'border-[#2b82e8]' : 'border-transparent'}`}
- >
-
-
-
setSelectedTab('강사')}
- className={`border-b-[2px] border-solid box-border content-stretch flex gap-[150px] items-center relative shrink-0 ${selectedTab === '강사' ? 'border-[#2b82e8]' : 'border-transparent'}`}
- >
-
-
-
setSelectedTab('운영자')}
- className={`border-b-[2px] border-solid box-border content-stretch flex gap-[150px] items-center relative shrink-0 ${selectedTab === '운영자' ? 'border-[#2b82e8]' : 'border-transparent'}`}
- >
-
-
-
-
- {/* 사용자 목록 테이블 */}
-
- {/* 테이블 헤더 */}
-
-
- {/* 빈 상태 메시지 */}
-
-
-
-
- );
+ return null;
}
// 일반 사용자일 경우 기존 메인 페이지 표시