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);