diff --git a/src/pages/Login/index.css b/src/pages/Login/index.css index 6e7d2e7..1e8c67e 100644 --- a/src/pages/Login/index.css +++ b/src/pages/Login/index.css @@ -1,4 +1,4 @@ -input { +td input { padding: 5px; font-size: 14px; -} \ No newline at end of file +} diff --git a/src/pages/Login/index.tsx b/src/pages/Login/index.tsx index be01327..bdeb53c 100644 --- a/src/pages/Login/index.tsx +++ b/src/pages/Login/index.tsx @@ -24,12 +24,13 @@ function Login() { e.preventDefault(); try { const res = await loginService({ username: form.username, password: form.password }) - if (res.error.response.status == 400) { - setErrorMsg(res.error.response.data.errors) - return - } - + if(res.error) { + if (res.error.response.status == 400) { + setErrorMsg(res.error.response.data.errors) + return + } + alert(res.error.response.data.message) return } @@ -77,7 +78,6 @@ function Login() { function onChangeInput(e: ChangeEvent) { const val = e.target as HTMLInputElement; setFrom({ ...form, [val.placeholder]: val.value }) - } return ( @@ -91,7 +91,7 @@ function Login() { - password: + password: