"use client" import { useState } from "react" import { useRouter } from "next/navigation" import Link from "next/link" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Label } from "@/components/ui/label" import { Sparkles, Settings, Eye, EyeOff, AlertCircle } from "lucide-react" import HeaderMusicControl from "@/components/header-music-control" import IpDisplay from "@/components/ip-display" export default function AdminLoginPage() { const router = useRouter() const [formData, setFormData] = useState({ email: "", password: "" }) const [showPassword, setShowPassword] = useState(false) const [error, setError] = useState("") const [loading, setLoading] = useState(false) const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() setLoading(true) setError("") try { // 模擬登入驗證 if (formData.email === "admin@panjit.com.tw" && formData.password === "Aa123456") { // 登入成功,設置 session 並跳轉到後台 sessionStorage.setItem("adminLoggedIn", "true") router.push("/admin") } else { setError("帳號或密碼錯誤") } } catch (error) { setError("登入失敗,請稍後再試") } finally { setLoading(false) } } const handleInputChange = (e: React.ChangeEvent) => { const { name, value } = e.target setFormData(prev => ({ ...prev, [name]: value })) } return (
{/* 星空背景 */}
{/* Header */}
{/* Logo 區域 */}

資訊部.心願星河

{/* 導航區域 */}
{/* 主要內容 */}
{/* 標題區域 */}

後台管理登入

請輸入管理員帳號密碼以進入後台管理系統

{/* 登入表單 */} 管理員登入 輸入您的管理員憑證
{/* 錯誤訊息 */} {error && (
{error}
)} {/* 帳號輸入 */}
{/* 密碼輸入 */}
{/* 登入按鈕 */} {/* 返回首頁 */}
← 返回首頁
{/* 提示資訊 */}

忘記密碼?請聯繫系統管理員

) }