g# This is a combination of 6 commits. (#675)

perf: node render

perf: react flow performance

config

perf: pg index

perf: oauth login

doc

doc
This commit is contained in:
Archer
2024-01-01 13:46:09 +08:00
committed by GitHub
parent 9ccfda47b7
commit d645a7406b
13 changed files with 31 additions and 678 deletions

View File

@@ -10,8 +10,10 @@ import { useToast } from '@/web/common/hooks/useToast';
import Loading from '@/components/Loading';
import { serviceSideProps } from '@/web/common/utils/i18n';
import { getErrText } from '@fastgpt/global/common/error/utils';
import { useTranslation } from 'next-i18next';
const provider = ({ code, state }: { code: string; state: string }) => {
const provider = ({ code, state, error }: { code: string; state: string; error?: string }) => {
const { t } = useTranslation();
const { loginStore } = useSystemStore();
const { setLastChatId, setLastChatAppId } = useChatStore();
const { setUserInfo } = useUserStore();
@@ -75,6 +77,14 @@ const provider = ({ code, state }: { code: string; state: string }) => {
useEffect(() => {
clearToken();
router.prefetch('/app/list');
if (error) {
toast({
status: 'warning',
title: t('support.user.login.Provider error')
});
router.replace('/login');
return;
}
if (!code) return;
if (state !== loginStore?.state) {
@@ -98,6 +108,7 @@ export async function getServerSideProps(content: any) {
props: {
code: content?.query?.code,
state: content?.query?.state,
error: content?.query?.error,
...(await serviceSideProps(content))
}
};