From 18c3ac3ad5972845cd9231e70e500c8bf04f86c0 Mon Sep 17 00:00:00 2001 From: optrader Date: Tue, 9 Dec 2025 18:18:51 +0900 Subject: [PATCH] =?UTF-8?q?[251209]=20fix:=20=EB=B0=B1=ED=99=94=ED=98=84?= =?UTF-8?q?=EC=83=81=20=EB=94=94=EB=B2=84=EA=B9=85-1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ• ์ปค๋ฐ‹ ์‹œ๊ฐ„: 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 ์„œ๋น„์Šค ๋ ˆ์ด์–ด ๊ฐœ์„  โ€ข ์†Œ๊ทœ๋ชจ ๊ธฐ๋Šฅ ๊ฐœ์„  --- .../src/actions/homeActions.js | 20 ++++++++++++++++++- com.twin.app.shoptime/src/api/TAxios.js | 12 ++++++++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/com.twin.app.shoptime/src/actions/homeActions.js b/com.twin.app.shoptime/src/actions/homeActions.js index 9ad0f497..1e687797 100644 --- a/com.twin.app.shoptime/src/actions/homeActions.js +++ b/com.twin.app.shoptime/src/actions/homeActions.js @@ -4,6 +4,8 @@ import { types } from './actionTypes'; import { changeAppStatus, getTermsAgreeYn } from './commonActions'; import { collectBannerPositions } from '../utils/domUtils'; import { createDebugHelpers } from '../utils/debug'; +import { setHidePopup, setShowPopup } from './commonActions'; +import { ACTIVE_POPUP } from '../utils/Config'; // ๋””๋ฒ„๊ทธ ํ—ฌํผ ์„ค์ • const DEBUG_MODE = false; @@ -76,9 +78,18 @@ export const getHomeTerms = (props) => (dispatch, getState) => { const onFail = (error) => { derror('getHomeTerms onFail ', error); + // TODO: ์ž„์‹œ ๋””๋ฒ„๊ทธ์šฉ ํŒ์—… (์žฌํ˜„ ํ›„ ์ œ๊ฑฐํ•˜์„ธ์š”) + const retCode = error?.data?.retCode ?? error?.retCode ?? 'unknown'; + dispatch( + setShowPopup(ACTIVE_POPUP.toast, { + button1Text: `getHomeTerms onFail retCode=${retCode}`, + button2Text: 'OK', + }) + ); + setTimeout(() => dispatch(setHidePopup()), 1500); + // ์•ฝ๊ด€ ๋ฏธ๋™์˜(retCode 501)๋กœ GET_HOME_TERMS๊ฐ€ ์‹คํŒจํ•˜๋ฉด // introTermsAgree๋ฅผ ๋ช…์‹œ์ ์œผ๋กœ false๋กœ ๋‚ด๋ ค ์•ฑ์ด IntroPanel์„ ๋„์šฐ๋„๋ก ํ•œ๋‹ค. - const retCode = error?.data?.retCode ?? error?.retCode; if (retCode === 501) { dispatch({ type: types.GET_TERMS_AGREE_YN_SUCCESS, @@ -91,6 +102,13 @@ export const getHomeTerms = (props) => (dispatch, getState) => { }, }); } + + // ์‹คํŒจ ์‹œ ๋กœ๋”ฉ ํŒจ๋„์„ ๋ฐ˜๋“œ์‹œ ๋‚ด๋ ค ๋ฐฑํ™” ์ƒํƒœ๋ฅผ ๋ฐฉ์ง€ + dispatch( + changeAppStatus({ + showLoadingPanel: { show: false }, + }) + ); }; TAxios( diff --git a/com.twin.app.shoptime/src/api/TAxios.js b/com.twin.app.shoptime/src/api/TAxios.js index 172b4c7d..33539fe4 100644 --- a/com.twin.app.shoptime/src/api/TAxios.js +++ b/com.twin.app.shoptime/src/api/TAxios.js @@ -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) {