From eced64dbf82c33c6e93b0368ea1afba71d87f691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E7=99=BB=E5=B1=B1?= Date: Mon, 2 Feb 2026 14:53:17 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20403Page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contexts/api-context.tsx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/contexts/api-context.tsx b/contexts/api-context.tsx index 3c6412e..7a9baf8 100644 --- a/contexts/api-context.tsx +++ b/contexts/api-context.tsx @@ -1,18 +1,12 @@ "use client" -import { - createContext, - useContext, - useEffect, - useState, -} from "react" +import { createContext, useContext, useEffect, useState } from "react" import { ApiClient } from "@/lib/api-client" import { AwsClient } from "@/lib/aws4fetch" import { ApiErrorHandler } from "@/lib/api-error-handler" import { useAuth } from "@/contexts/auth-context" import { configManager } from "@/lib/config" -import { getLoginRoute } from "@/lib/routes" -import type { SiteConfig } from "@/types/config" +import { getLoginRoute, buildRoute } from "@/lib/routes" interface ApiContextValue { api: ApiClient | null @@ -60,7 +54,7 @@ export function ApiProvider({ children }: { children: React.ReactNode }) { window.location.href = getLoginRoute() }, onForbidden: async () => { - window.location.href = "/403" + window.location.href = buildRoute("/403") }, })