로그인 오류 관련 alert 수정

This commit is contained in:
yoon 2025-03-20 11:00:19 +09:00
parent b374d9ce80
commit 13a80e479a
2 changed files with 10 additions and 4 deletions

View File

@ -41,8 +41,14 @@ $api.interceptors.response.use(
const loadingStore = useLoadingStore();
loadingStore.stopLoading();
// 로그인 요청일 경우 (헤더에 isLogin이 true로 설정된 경우)
if (response.config.headers && response.config.headers.isLogin) {
return response;
}
// 테스트 부탁
// 로그인 실패, 커스텀 에러 응답 처리 (status는 200 success가 false인 경우)
// 로그인 실패, 커스텀 에러 응답 처리
if (response.data.code > 10000) {
const toastStore = useToastStore();
const errorCode = response.data.code;

View File

@ -71,10 +71,10 @@
remember: remember.value,
}, { headers: { isLogin: true } })
.then(async res => {
// (success false )
if (res.data && res.data.success === false) {
//
if (res.data.code > 10000) {
//
errorMessage.value = res.data.message || '로그인에 실패했습니다.';
errorMessage.value = res.data.message;
return;
}