From e09f6f28c3c27f9e93aaecbf120884206ee30fd2 Mon Sep 17 00:00:00 2001 From: mtvpls Date: Wed, 29 Apr 2026 21:23:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=BC=BA=E5=88=B6=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E4=BB=A5=E5=88=B7=E6=96=B0=E7=94=A8=E6=88=B7=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/login/page.tsx | 2 +- src/app/oidc-register/page.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 1fb174b..9be5f19 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -248,7 +248,7 @@ function LoginPageClient() { } const redirect = searchParams.get('redirect') || '/'; - router.replace(redirect); + window.location.replace(redirect); } else { // 登录失败,重置Turnstile if (siteConfig?.LoginRequireTurnstile && turnstileWidgetId !== null && (window as any).turnstile) { diff --git a/src/app/oidc-register/page.tsx b/src/app/oidc-register/page.tsx index 45088db..a1252dd 100644 --- a/src/app/oidc-register/page.tsx +++ b/src/app/oidc-register/page.tsx @@ -56,8 +56,8 @@ function OIDCRegisterPageClient() { }); if (res.ok) { - // 注册成功,跳转到首页 - router.replace('/'); + // 注册成功,接口已写入认证 cookie,这里用整页跳转确保权限配置和登录态完全重建 + window.location.replace('/'); } else { const data = await res.json().catch(() => ({})); setError(data.error || '注册失败');