fix: wr 하수재이용통계

This commit is contained in:
dongsilove
2025-10-24 23:42:03 +09:00
parent 1e14b464a4
commit e71c50e9ad
2 changed files with 10 additions and 11 deletions
+1 -1
View File
@@ -8,6 +8,6 @@ export default function RootLayout({
return (
{children}
<>{children}</>
);
}
@@ -19,21 +19,20 @@ export default function HasuStatPage() {
if (!res.ok) throw new Error("no-ip");
const data = await res.json();
const ip: string = data?.ip || "";
console.log("Client IP:", ip);
if (didCancel) return;
alert("Client IP:" + ip);
const is10 = /^10\./.test(ip);
setStatus(is10 ? "redirect-internal" : "redirect-root");
// // Use location.replace so user can't go back to this page
// if (is10) {
// // redirect to internal IP
// // window.location.replace("http://10.101.163.102:8888/cms/lay1/WS10000014/program.do");
// window.open('http://10.101.163.102:8888/cms/lay1/WS10000014/program.do', '_blank');
// } else {
// //window.location.replace("https://www.hasudoinfo.or.kr/cms/lay1/WS10000014/program.do");
// window.open('https://www.hasudoinfo.or.kr/cms/lay1/WS10000014/program.do', '_blank');
// }
// Use location.replace so user can't go back to this page
if (is10) {
// redirect to internal IP
window.open('http://10.101.163.102:8888/cms/lay1/WS10000014/program.do', '_blank');
} else {
window.open('https://www.hasudoinfo.or.kr/cms/lay1/WS10000014/program.do', '_blank');
}
window.history.back();
} catch {
// If anything fails, fall back to root
if (!didCancel) {