From ae96324783088d4d445a01ccf78d918e900382b8 Mon Sep 17 00:00:00 2001 From: ljpark Date: Tue, 30 Dec 2025 10:08:36 +0900 Subject: [PATCH] =?UTF-8?q?fo:=20undefined=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/fo/app/store/dashboard/index.tsx | 12 +++++------- apps/fo/src/entities/auth/lib/auth-wrapper.tsx | 6 +++--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/fo/app/store/dashboard/index.tsx b/apps/fo/app/store/dashboard/index.tsx index ac041391e..60267e388 100644 --- a/apps/fo/app/store/dashboard/index.tsx +++ b/apps/fo/app/store/dashboard/index.tsx @@ -1495,9 +1495,10 @@ export const dashBoardReducer: (set: (fn: (state: DashBoardType) => DashBoardTyp const bscFctCd = fcltyCd; const res2 = await fetchFlowRateModalList(bscFctCd, searchYear); // /fclt/flow/ - const calData = CalcRainEffect(clone(res2.data), 'SUNNY'); - const calRainData = CalcRainEffect(clone(res2.data), 'RAIN'); + //const calData = CalcRainEffect(clone(res2.data), 'SUNNY'); + //const calRainData = CalcRainEffect(clone(res2.data), 'RAIN'); + let cntSunnyDay = 0; // 청천일 수 // 지하수유입량 - 청천시 기준 let chungcunSumFlow = 0; let sumSummerChungcunFlow = 0; @@ -1540,6 +1541,7 @@ export const dashBoardReducer: (set: (fn: (state: DashBoardType) => DashBoardTyp summerRainDayEfflFlow += efflAmnt; } } else if (rainEffectDay < 0) { + cntSunnyDay += 1; // 청천일수 // 청천시 chungcunSumFlow += inflAmnt; @@ -1651,7 +1653,7 @@ export const dashBoardReducer: (set: (fn: (state: DashBoardType) => DashBoardTyp operationalStatusList[0].winterSunnyAvg = roundUp(Number(operationalStatusList[0].winterSunnyAvg), 0) + roundUp(winterSunnyAvg, 0); // 지하수유입량 - const usage = chungcunSumFlow / calData.length; + const usage = chungcunSumFlow / cntSunnyDay; //calData.length; const summerUsage = sumSummerChungcunFlow / summerChungchunDay; const winterUsage = sumWinterChungcunFlow / winterChungchuDay; @@ -1664,10 +1666,6 @@ export const dashBoardReducer: (set: (fn: (state: DashBoardType) => DashBoardTyp operationalStatusList[0].groundWaterSummer = Math.round((summerUsage - (summerUsage * 0.65 * OSU_PERCENT)) * 100) / 100; operationalStatusList[0].groundWaterWinter = Math.round((winterUsage - (winterUsage * 0.65 * OSU_PERCENT)) * 100) / 100; - //operationalStatusList[0].groundWaterAvg = calData.length === 0 ? '' : Number(calData[0].inflAmnt) - (Number(calData[0].inflAmnt)*0.65*0.8); - //operationalStatusList[0].groundWaterSummer = calData.length === 0 ? '' : Number(calData[0].inflAmnt) - (Number(calData[0].inflAmnt)*0.65*0.8); - //operationalStatusList[0].groundWaterWinter = calData.length === 0 ? '' : Number(calData[0].inflAmnt) - (Number(calData[0].inflAmnt)*0.65*0.8); - // 오염물질 // RDII 추정 = 하절기(6~8월) 중 최저 유입 BOD일때 유입유량 x ((동절기 청천시 유입BOD - 하절기(6~8월) 중 최저 유입BOD) / (동절기 청천시 유입BOD)) const resp = await fetchMainGraph(searchYear, fcltyCd); diff --git a/apps/fo/src/entities/auth/lib/auth-wrapper.tsx b/apps/fo/src/entities/auth/lib/auth-wrapper.tsx index c1b2ecd99..0c2d04830 100644 --- a/apps/fo/src/entities/auth/lib/auth-wrapper.tsx +++ b/apps/fo/src/entities/auth/lib/auth-wrapper.tsx @@ -1,7 +1,7 @@ "use client"; import { useEffect } from "react"; -import { useRouter} from "next/navigation"; +import { useRouter, usePathname } from "next/navigation"; import { client } from "@/src/shared/api"; import type { IUserInfo } from "@/src/shared/store"; import { useUserStore, getCookie } from "@/src/shared/lib"; @@ -12,7 +12,7 @@ const LOGIN_PAGE_URL = process.env.NEXT_PUBLIC_CM_LOGIN_PAGE_URL || "http://loca const AuthWrapper = ({ children }: { children: React.ReactNode }) => { const router = useRouter(); - // const pathname = usePathname(); + const pathname = usePathname(); const { userInfo, setUserInfo } = useUserStore((state) => state); async function authCheck() { @@ -53,7 +53,7 @@ const AuthWrapper = ({ children }: { children: React.ReactNode }) => { } } })(); - }, []); + }, [pathname]); return <>{children}; };