"use client"; import { useEffect } from "react"; /** * Catches root-level errors (e.g. backend down during deploy). * Redirects to login instead of showing the default "Application error" page. * Must define and because this replaces the root layout. */ export default function GlobalError({ error, reset, }: { error: Error & { digest?: string }; reset: () => void; }) { useEffect(() => { window.location.href = "/login"; }, []); return (

連線異常,正在導向登入頁…

); }