Merge branch 'main' into vacation
This commit is contained in:
commit
184bf4bd2b
@ -41,22 +41,18 @@ $api.interceptors.response.use(
|
|||||||
const loadingStore = useLoadingStore();
|
const loadingStore = useLoadingStore();
|
||||||
loadingStore.stopLoading();
|
loadingStore.stopLoading();
|
||||||
|
|
||||||
|
// 테스트 부탁
|
||||||
// 로그인 실패, 커스텀 에러 응답 처리 (status는 200 success가 false인 경우)
|
// 로그인 실패, 커스텀 에러 응답 처리 (status는 200 success가 false인 경우)
|
||||||
if (response.data && response.data.success === false) {
|
if (response.data.code > 10000) {
|
||||||
const toastStore = useToastStore();
|
const toastStore = useToastStore();
|
||||||
const errorCode = response.data.code;
|
const errorCode = response.data.code;
|
||||||
const errorMessage = response.data.message || '알 수 없는 오류가 발생했습니다.';
|
const errorMessage = response.data.message || '알 수 없는 오류가 발생했습니다.';
|
||||||
|
|
||||||
// 로그인 요청일 경우 (헤더에 isLogin이 true로 설정된 경우)
|
|
||||||
if (response.config.headers && response.config.headers.isLogin) {
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 서버에서 보낸 메시지 사용
|
// 서버에서 보낸 메시지 사용
|
||||||
toastStore.onToast(errorMessage, 'e');
|
toastStore.onToast(errorMessage, 'e');
|
||||||
|
|
||||||
// 특정 에러 코드에 대한 추가 처리만 수행
|
// 특정 에러 코드에 대한 추가 처리만 수행
|
||||||
if (errorCode === 'USER_NOT_FOUND') {
|
if (errorCode === 10001) {
|
||||||
router.push('/login');
|
router.push('/login');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
:value="computedValue"
|
:value="computedValue"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:maxLength="maxlength"
|
:maxLength="maxlength"
|
||||||
|
:minLength="minlength"
|
||||||
:placeholder="title"
|
:placeholder="title"
|
||||||
@blur="$emit('blur')"
|
@blur="$emit('blur')"
|
||||||
/>
|
/>
|
||||||
@ -29,6 +30,7 @@
|
|||||||
:value="computedValue"
|
:value="computedValue"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:maxLength="maxlength"
|
:maxLength="maxlength"
|
||||||
|
:minLength="minlength"
|
||||||
:placeholder="title"
|
:placeholder="title"
|
||||||
@blur="$emit('blur')"
|
@blur="$emit('blur')"
|
||||||
/>
|
/>
|
||||||
@ -77,6 +79,11 @@
|
|||||||
default: 30,
|
default: 30,
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
|
minlength: {
|
||||||
|
type: Number,
|
||||||
|
default: 4,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
isAlert: {
|
isAlert: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user