import { useMutation } from "@tanstack/react-query"; import type { AxiosError } from "axios"; import { KeyRound, Lock, Mail, ShieldHalf } from "lucide-react"; import { useState } from "react"; import { useNavigate } from "react-router-dom"; import { Button } from "../../components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "../../components/ui/card"; import { Input } from "../../components/ui/input"; import { Label } from "../../components/ui/label"; import { login } from "../../lib/adminApi"; import { t } from "../../lib/i18n"; function LoginPage() { const navigate = useNavigate(); const [loginId, setLoginId] = useState(""); const [password, setPassword] = useState(""); const loginMutation = useMutation({ mutationFn: () => login({ loginId, password }), onSuccess: (data) => { window.localStorage.setItem("admin_session", data.sessionToken); navigate("/"); }, }); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); loginMutation.mutate(); }; const errorMsg = (loginMutation.error as AxiosError<{ error?: string }>)?.response ?.data?.error; return (
Admin Control Plane
인증 정보가 없거나 로그인이 되지 않는 경우
시스템 관리자에게 문의하세요.