From 3f193650d227daad5287081f66ac580ebd04c71d Mon Sep 17 00:00:00 2001 From: wood chen Date: Fri, 21 Feb 2025 16:20:37 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0README=E4=BB=A5?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A3=80=E6=9F=A5=E7=82=B9=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=EF=BC=9B=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E9=87=8D=E5=AE=9A=E5=90=91=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++++ src/components/auth/user-authorize.tsx | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8482f9d..afa4ee4 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,12 @@ Q58论坛网址: https://q58.club 本项目部署在vercel, 数据库使用Neon. +## 需要检查的几点 + +1. 直接登录本系统 +2. 未登录本系统, 未登录q58论坛, 检查: 用户在接入应用中登录, 然后登录本系统, 然后登录q58论坛, 正常一直回调到用户应用 +3. 未登录本系统, 登录了q58论坛, 检查: 用户在接入应用中登录, 然后登录本系统, 正常回调到用户应用 + ## 许可证 本项目采用 MIT 许可证。详情请见 [LICENSE](LICENSE) 文件。 diff --git a/src/components/auth/user-authorize.tsx b/src/components/auth/user-authorize.tsx index f2b19b4..52bb7c9 100644 --- a/src/components/auth/user-authorize.tsx +++ b/src/components/auth/user-authorize.tsx @@ -46,8 +46,15 @@ export function UserAuthorize({ await update(); // 添加更长的延迟确保session完全更新 await new Promise((resolve) => setTimeout(resolve, 1000)); - // 强制刷新页面状态 - router.refresh(); + // 检查URL中是否存在重定向参数 + const redirectTo = url.searchParams.get("redirect_to"); + if (redirectTo) { + // 如果存在重定向参数,则跳转到指定的URL + window.location.href = redirectTo; + } else { + // 如果不存在重定向参数,则刷新当前页面状态 + router.refresh(); + } setIsLoading(false); } catch (error) { console.error("登录过程出错:", error);