diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
index 52cce6f8..9ab3e266 100644
--- a/.idea/deploymentTargetDropDown.xml
+++ b/.idea/deploymentTargetDropDown.xml
@@ -12,6 +12,6 @@
-
+
\ No newline at end of file
diff --git a/app/src/main/java/umc/com/mobile/project/ui/login/LoginActivity.kt b/app/src/main/java/umc/com/mobile/project/ui/login/LoginActivity.kt
index 10e20ad5..5aaa8108 100644
--- a/app/src/main/java/umc/com/mobile/project/ui/login/LoginActivity.kt
+++ b/app/src/main/java/umc/com/mobile/project/ui/login/LoginActivity.kt
@@ -36,11 +36,11 @@ class LoginActivity : AppCompatActivity() {
viewModel.login()
}
- viewModel.loginStatus.observe(this, Observer { loginStatus ->
- if (!loginStatus) {
+ viewModel.loginSuccess.observe(this, Observer { loginSuccess ->
+ if (!loginSuccess) {
val intent = Intent(this@LoginActivity, MainActivity::class.java)
startActivity(intent)
- finish() // 로그인 성공시 로그인 액티비티 종료
+ finish()
} else {
// 로그인 실패시 처리할 로직 추가 가능
}
diff --git a/app/src/main/java/umc/com/mobile/project/ui/login/viewmodel/LoginViewModel.kt b/app/src/main/java/umc/com/mobile/project/ui/login/viewmodel/LoginViewModel.kt
index 98259adb..76fd26ed 100644
--- a/app/src/main/java/umc/com/mobile/project/ui/login/viewmodel/LoginViewModel.kt
+++ b/app/src/main/java/umc/com/mobile/project/ui/login/viewmodel/LoginViewModel.kt
@@ -49,6 +49,10 @@ class LoginViewModel : ViewModel() {
fun init() {
id.postValue("")
pw.postValue("")
+ _loginSuccess.postValue(false)
+ }
+
+ init {
_loginStatus.postValue(false)
}
@@ -71,7 +75,7 @@ class LoginViewModel : ViewModel() {
)
}
_loginResult.postValue(response.body())
- _loginStatus.postValue(false)
+ _loginSuccess.postValue(false)
Log.d("cookies", "$cookies")
Log.d("Login", "${response.body()}")
@@ -84,7 +88,9 @@ class LoginViewModel : ViewModel() {
result = null
)
)
+ _loginSuccess.postValue(true)
_loginStatus.postValue(true)
+
Log.e("Login", "정보 틀림: $loginResult")
}
}
@@ -98,7 +104,9 @@ class LoginViewModel : ViewModel() {
result = null
)
)
+ _loginSuccess.postValue(true)
_loginStatus.postValue(true)
+
Log.e("Login", "네트워크 오류: $loginResult / $loginStatus")
}
})
diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml
index 7b854dcb..9e8274d7 100644
--- a/app/src/main/res/layout/activity_login.xml
+++ b/app/src/main/res/layout/activity_login.xml
@@ -147,14 +147,5 @@
android:text="@string/login_title"
android:textColor="@color/white" />
-
-
\ No newline at end of file