diff --git a/WebContent/jsp/common/screen/emergency.jsp b/WebContent/jsp/common/screen/emergency.jsp index 68b9132..0af95ef 100644 --- a/WebContent/jsp/common/screen/emergency.jsp +++ b/WebContent/jsp/common/screen/emergency.jsp @@ -105,6 +105,7 @@ data: $('#loginForm').serialize(), dataType: 'json', success: function(response) { + console.log('res', response) if (response.changePassword) { showChangeInitPassword(response); } @@ -116,8 +117,14 @@ // 직접 로그인 성공 window.location.href = response.redirectUrl; } else { - // 로그인 실패 - alert('로그인에 실패했습니다'); + if (response.errorMessage == 'NO_PHONE_NUMBER') { + alert("휴대폰번호가 등록되어 있지 않아 로그인할 수 없습니다. 관리자에게 문의하세요") + } else if (response.errorMessage == 'FAIL_SEND_AUTH') { + alert("인증번호 발송에 실패했습니다. 잠시 후 다시 시도해주세요.") + } else { + // 로그인 실패 + alert('로그인에 실패했습니다'); + } } }, error: function(xhr, status, error) { diff --git a/src/main/java/com/eactive/eai/rms/common/login/MainController.java b/src/main/java/com/eactive/eai/rms/common/login/MainController.java index 106ede9..bf02e01 100644 --- a/src/main/java/com/eactive/eai/rms/common/login/MainController.java +++ b/src/main/java/com/eactive/eai/rms/common/login/MainController.java @@ -223,7 +223,7 @@ public class MainController implements InterceptorSkipController { // 휴대폰번호 없는 사용자 return LoginResponseDto.builder() .success(false) - .errorMessage("휴대폰번호가 등록되어 있지 않아 로그인할 수 없습니다. 관리자에게 문의하세요.") + .errorMessage("NO_PHONE_NUMBER") .build(); } @@ -234,7 +234,7 @@ public class MainController implements InterceptorSkipController { if (!sent) { return LoginResponseDto.builder() .success(false) - .errorMessage("인증번호 발송에 실패했습니다. 잠시 후 다시 시도해주세요.") + .errorMessage("FAIL_SEND_AUTH") .build(); }