From 5969f5e0c5e04b83e1096ddfda6b08eca5db0110 Mon Sep 17 00:00:00 2001 From: archer <545436317@qq.com> Date: Fri, 28 Apr 2023 14:16:30 +0800 Subject: [PATCH] docs and login direct --- public/docs/versionIntro.md | 12 ++++++------ src/components/Layout/auth.tsx | 4 +++- src/pages/login/index.tsx | 7 +++++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/public/docs/versionIntro.md b/public/docs/versionIntro.md index ca022f29d..d8bba37e8 100644 --- a/public/docs/versionIntro.md +++ b/public/docs/versionIntro.md @@ -1,6 +1,6 @@ -### Fast GPT V2.8.1 -* 新增 - 暂停聊天。 -* 优化 - 知识库升级,内容条数不上限! -* 优化 - 导入去重效果,可防止导出后的 csv 重复导入。 -* 优化 - 聊天框,电脑端复制删除图标。 -* 优化 - 聊天框,生成内容时,如果滚动条触底,则会自动向下滚动,不需要手动下滑。 \ No newline at end of file +### Fast GPT V3.0 + +- 新增 - 模型共享市场,可以使用其他用户分享的模型。 +- 新增 - 邀请好友注册功能。 +- 优化 - 选择文件,采用链式处理,避免卡死。 +- 修复 - 导入时分段问题。 diff --git a/src/components/Layout/auth.tsx b/src/components/Layout/auth.tsx index 0a6de34a2..09b5977c5 100644 --- a/src/components/Layout/auth.tsx +++ b/src/components/Layout/auth.tsx @@ -34,7 +34,9 @@ const Auth = ({ children }: { children: JSX.Element }) => { { onError(error) { console.log('error->', error); - router.replace('/login'); + router.replace( + `/login?lastRoute=${encodeURIComponent(location.pathname + location.search)}` + ); toast(); }, onSettled() { diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index 93bbc960b..f4c2c1715 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -13,6 +13,7 @@ const ForgetPasswordForm = dynamic(() => import('./components/ForgetPasswordForm const Login = () => { const router = useRouter(); + const { lastRoute = '' } = router.query as { lastRoute: string }; const { isPc } = useScreen(); const [pageType, setPageType] = useState<`${PageTypeEnum}`>(PageTypeEnum.login); const { setUserInfo } = useUserStore(); @@ -20,9 +21,11 @@ const Login = () => { const loginSuccess = useCallback( (res: ResLogin) => { setUserInfo(res.user, res.token); - router.push('/model/list'); + setTimeout(() => { + router.push(lastRoute ? decodeURIComponent(lastRoute) : '/model/list'); + }, 100); }, - [router, setUserInfo] + [lastRoute, router, setUserInfo] ); function DynamicComponent({ type }: { type: `${PageTypeEnum}` }) {