file rename
This commit is contained in:
@@ -19,8 +19,8 @@ export default function LoginPage() {
|
||||
const [isUserIdFocused, setIsUserIdFocused] = useState(false);
|
||||
const [isPasswordFocused, setIsPasswordFocused] = useState(false);
|
||||
const [isLoginErrorOpen, setIsLoginErrorOpen] = useState(false);
|
||||
const [idError, setIdError] = useState("");
|
||||
const [passwordError, setPasswordError] = useState("");
|
||||
const [idError, setIdError] = useState("");
|
||||
const [passwordError, setPasswordError] = useState("");
|
||||
|
||||
async function handleSubmit(e: React.FormEvent<HTMLFormElement>) {
|
||||
e.preventDefault();
|
||||
@@ -31,7 +31,7 @@ export default function LoginPage() {
|
||||
try {
|
||||
const response = await fetch("https://hrdi.coconutmeet.net/auth/login", {
|
||||
method: "POST",
|
||||
headers: {"Content-Type": "application/json",},
|
||||
headers: { "Content-Type": "application/json", },
|
||||
body: JSON.stringify({
|
||||
email: userId,
|
||||
password: password
|
||||
@@ -61,7 +61,7 @@ export default function LoginPage() {
|
||||
|
||||
const data = await response.json();
|
||||
console.log("로그인 성공:", data);
|
||||
|
||||
|
||||
// 로그인 성공 시 토큰 저장 (다양한 필드명 지원)
|
||||
const token = data.token || data.accessToken || data.access_token;
|
||||
if (token) {
|
||||
@@ -73,11 +73,11 @@ export default function LoginPage() {
|
||||
console.warn("토큰이 응답에 없습니다. 응답 데이터:", data);
|
||||
// 토큰이 없어도 로그인은 성공했으므로 진행
|
||||
}
|
||||
|
||||
|
||||
// 리다이렉트 경로 확인
|
||||
const searchParams = new URLSearchParams(window.location.search);
|
||||
const redirectPath = searchParams.get('redirect') || '/';
|
||||
|
||||
|
||||
// 메인 페이지로 이동
|
||||
router.push(redirectPath);
|
||||
} catch (error) {
|
||||
@@ -94,18 +94,18 @@ export default function LoginPage() {
|
||||
open={isLoginErrorOpen}
|
||||
onClose={() => setIsLoginErrorOpen(false)}
|
||||
/>
|
||||
<LoginOption
|
||||
<LoginOption
|
||||
onClick={() => setIsLoginErrorOpen(true)}
|
||||
loginErrorModalEnabled={isLoginErrorOpen}
|
||||
setLoginErrorModalEnabled={setIsLoginErrorOpen}
|
||||
loginErrorModalEnabled={isLoginErrorOpen}
|
||||
setLoginErrorModalEnabled={setIsLoginErrorOpen}
|
||||
/>
|
||||
|
||||
<div className="rounded-xl bg-white max-w-[560px] px-[40px] w-full">
|
||||
{/* 로고 영역 */}
|
||||
<div className="my-15 flex flex-col items-center">
|
||||
<div className="mb-[7px]">
|
||||
<MainLogo/>
|
||||
</div>
|
||||
<div className="mb-[7px]">
|
||||
<MainLogo />
|
||||
</div>
|
||||
<div className="text-[28.8px] font-extrabold leading-[145%] text-neutral-700" >
|
||||
XR LMS
|
||||
</div>
|
||||
@@ -249,11 +249,10 @@ export default function LoginPage() {
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<p className="text-center py-[40px] text-[15px] text-basic-text">
|
||||
Copyright ⓒ 2025 XL LMS. All rights reserved
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user