fix: wr 하수재이용통계
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user