deeplink debug 코드 추가

This commit is contained in:
opacity@t-win.kr
2025-08-22 10:14:53 +09:00
parent afb3be7df5
commit 9bc8d6f68f
8 changed files with 633 additions and 164 deletions

View File

@@ -13,6 +13,16 @@ import { sendLogTotalRecommend } from "../actions/logActions";
//V2_진입경로코드_진입경로명_MT_노출순번
export const handleDeepLink = (contentTarget) => (dispatch, getState) => {
console.log("[handleDeepLink] ~ contentTarget: ", contentTarget);
// 🔍 DEEPLINK DEBUG: 딥링크 핸들러 시작
console.log("🔍 [DEEPLINK DEBUG] ===== handleDeepLink 실행 =====");
console.log("🔍 [DEEPLINK DEBUG] contentTarget:", contentTarget);
console.log("🔍 [DEEPLINK DEBUG] contentTarget 타입:", typeof contentTarget);
console.log(
"🔍 [DEEPLINK DEBUG] contentTarget null/undefined 여부:",
contentTarget === null || contentTarget === undefined
);
let linkTpCd; // 진입경로코드
let linkTpNm; // 진입경로명
let type; // 링크 타입
@@ -29,11 +39,22 @@ export const handleDeepLink = (contentTarget) => (dispatch, getState) => {
let tabType; // 카테고리 탭명
if (contentTarget === null || contentTarget === undefined) {
console.log(
"🔍 [DEEPLINK DEBUG] ⚠️ contentTarget이 null/undefined - 기본값 설정"
);
linkTpCd = "1000";
linkTpNm = LOG_MENU.APP;
} else {
console.log("🔍 [DEEPLINK DEBUG] ✅ contentTarget 존재 - 파싱 시작");
const tokens = contentTarget.split("_");
console.log("🔍 [DEEPLINK DEBUG] 토큰 분리 결과:", tokens);
console.log("🔍 [DEEPLINK DEBUG] 버전:", tokens[0]);
console.log("🔍 [DEEPLINK DEBUG] 진입경로코드:", tokens[1]);
console.log("🔍 [DEEPLINK DEBUG] 진입경로명:", tokens[2]);
console.log("🔍 [DEEPLINK DEBUG] 타입:", tokens[3]);
if (tokens[0] === "V2" || tokens[0] === "V3") {
console.log("🔍 [DEEPLINK DEBUG] ✅ 유효한 딥링크 버전:", tokens[0]);
linkTpCd = tokens[1];
linkTpNm = tokens[2];
type = tokens[3];
@@ -43,19 +64,34 @@ export const handleDeepLink = (contentTarget) => (dispatch, getState) => {
let panelInfo = {};
if (tokens[0] === "V2") {
console.log(
"🔍 [DEEPLINK DEBUG] ⚠️ V2 버전 - HOME_PANEL로 이동 후 종료"
);
panelName = panel_names.HOME_PANEL;
return;
}
console.log("🔍 [DEEPLINK DEBUG] V3 버전 - 타입별 처리 시작");
if (parseInt(linkTpCd) < 2000 || parseInt(linkTpCd) > 8999) {
console.log(
"🔍 [DEEPLINK DEBUG] ⚠️ 유효하지 않은 진입경로코드:",
linkTpCd,
"-> 9999로 변경"
);
linkTpCd = "9999";
linkTpNm = LOG_MENU.UNKNOWN;
}
console.log("🔍 [DEEPLINK DEBUG] 최종 linkTpCd:", linkTpCd);
console.log("🔍 [DEEPLINK DEBUG] 최종 linkTpNm:", linkTpNm);
console.log("🔍 [DEEPLINK DEBUG] 처리할 타입:", type);
switch (type) {
case "MT":
// "MT": Main TOP
// V3_진입경로코드_진입경로명_MT_노출순번
console.log("🔍 [DEEPLINK DEBUG] ✅ MT 타입: Main TOP 처리");
panelName = panel_names.HOME_PANEL;
deeplinkPanel = "Main TOP";
break;
@@ -269,17 +305,45 @@ export const handleDeepLink = (contentTarget) => (dispatch, getState) => {
})
);
// 🔍 DEEPLINK DEBUG: 패널 이동 처리
console.log("🔍 [DEEPLINK DEBUG] ===== 패널 이동 처리 =====");
console.log("🔍 [DEEPLINK DEBUG] panelName:", panelName);
console.log("🔍 [DEEPLINK DEBUG] deeplinkPanel:", deeplinkPanel);
console.log("🔍 [DEEPLINK DEBUG] panelInfo:", panelInfo);
if (panelName) {
console.log("🔍 [DEEPLINK DEBUG] ✅ 패널 이동 실행");
const action =
panelName === panel_names.HOME_PANEL ? updateHomeInfo : pushPanel;
console.log(
"🔍 [DEEPLINK DEBUG] 사용할 액션:",
panelName === panel_names.HOME_PANEL ? "updateHomeInfo" : "pushPanel"
);
console.log("🔍 [DEEPLINK DEBUG] 최종 액션 파라미터:", {
name: panelName,
panelInfo: { ...panelInfo, linkTpCd },
});
dispatch(
action({
name: panelName,
panelInfo: { ...panelInfo, linkTpCd },
})
);
console.log("🔍 [DEEPLINK DEBUG] ✅ 패널 이동 디스패치 완료");
} else {
console.log(
"🔍 [DEEPLINK DEBUG] ❌ panelName이 없음 - 패널 이동하지 않음"
);
}
} else {
console.log(
"🔍 [DEEPLINK DEBUG] ❌ 유효하지 않은 딥링크 버전:",
tokens[0]
);
}
}
console.log("🔍 [DEEPLINK DEBUG] ===== handleDeepLink 종료 =====");
};