[251209] fix: 백화현상 디버깅-1
🕐 커밋 시간: 2025. 12. 09. 18:18:51 📊 변경 통계: • 총 파일: 2개 • 추가: +28줄 • 삭제: -4줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/actions/homeActions.js ~ com.twin.app.shoptime/src/api/TAxios.js 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선 • API 서비스 레이어 개선 • 소규모 기능 개선
This commit is contained in:
@@ -185,8 +185,14 @@ export const TAxios = (
|
||||
return;
|
||||
}
|
||||
|
||||
// 약관 미동의(501): 토큰 재발급 큐에 넣지 않고 바로 실패 처리
|
||||
if (res?.data?.retCode === 501) {
|
||||
if (onFail) onFail(res);
|
||||
return;
|
||||
}
|
||||
|
||||
// RefreshToken 만료
|
||||
if (res?.data?.retCode === 402 || res?.data?.retCode === 501) {
|
||||
if (res?.data?.retCode === 402) {
|
||||
if (baseUrl === URLS.GET_RE_AUTHENTICATION_CODE) {
|
||||
dispatch(getAuthenticationCode());
|
||||
} else {
|
||||
@@ -349,10 +355,10 @@ export const TAxiosAdvancedPromise = (
|
||||
console.error(`TAxiosPromise error on attempt ${attempts} for ${baseUrl}:`, error);
|
||||
|
||||
// Check if the error is due to token expiration
|
||||
// TAxios already handles token refresh and queueing for these codes (401, 402, 501)
|
||||
// TAxios already handles token refresh and queueing for 401/402 (501은 제외)
|
||||
// So we should NOT retry immediately in this loop, but let TAxios handle it.
|
||||
const retCode = error?.data?.retCode;
|
||||
const isTokenError = retCode === 401 || retCode === 402 || retCode === 501;
|
||||
const isTokenError = retCode === 401 || retCode === 402;
|
||||
|
||||
// 재시도 로직
|
||||
if (attempts < maxAttempts && !isTokenError) {
|
||||
|
||||
Reference in New Issue
Block a user