Skip to content

Commit

Permalink
perf: git login
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu committed Aug 28, 2023
1 parent 64b9367 commit 42fec3a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 130 deletions.
1 change: 0 additions & 1 deletion client/data/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"scripts": []
},
"SystemParams": {
"gitLoginSecret": "",
"vectorMaxProcess": 15,
"qaMaxProcess": 15,
"pgIvfflatProbe": 20
Expand Down
2 changes: 1 addition & 1 deletion client/src/api/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const sendAuthCode = (data: {

export const getTokenLogin = () => GET<UserType>('/user/account/tokenLogin');
export const gitLogin = (params: { code: string; inviterId?: string }) =>
GET<ResLogin>('/user/account/gitLogin', params);
GET<ResLogin>('/plusApi/user/account/gitLogin', params);

export const postRegister = ({
username,
Expand Down
120 changes: 0 additions & 120 deletions client/src/pages/api/user/account/gitLogin.ts

This file was deleted.

13 changes: 9 additions & 4 deletions client/src/pages/login/provider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect } from 'react';
import React, { useCallback } from 'react';
import { useRouter } from 'next/router';
import { useGlobalStore } from '@/store/global';
import { ResLogin } from '@/api/response/user';
Expand All @@ -10,6 +10,7 @@ import { useToast } from '@/hooks/useToast';
import Loading from '@/components/Loading';
import { serviceSideProps } from '@/utils/i18n';
import { useQuery } from '@tanstack/react-query';
import { getErrText } from '@/utils/tools';

const provider = ({ code }: { code: string }) => {
const { loginStore } = useGlobalStore();
Expand Down Expand Up @@ -56,15 +57,19 @@ const provider = ({ code }: { code: string }) => {
status: 'warning',
title: '登录异常'
});
return router.replace('/login');
return setTimeout(() => {
router.replace('/login');
}, 1000);
}
loginSuccess(res);
} catch (error) {
toast({
status: 'warning',
title: '登录异常'
title: getErrText(error, '登录异常')
});
router.replace('/login');
setTimeout(() => {
router.replace('/login');
}, 1000);
}
}, [code, loginStore, loginSuccess]);

Expand Down
1 change: 0 additions & 1 deletion client/src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export type FeConfigsType = {
};
export type SystemEnvType = {
pluginBaseUrl?: string;
gitLoginSecret?: string;
vectorMaxProcess: number;
qaMaxProcess: number;
pgIvfflatProbe: number;
Expand Down
2 changes: 0 additions & 2 deletions docSite/content/docs/installation/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ weight: 751
...
// 这个配置文件是系统级参数
"SystemParams": {
"gitLoginSecret": "", // Git 登录凭证
"vectorMaxProcess": 15, // 向量生成最大进程,结合数据库性能和 key 来设置
"qaMaxProcess": 15, // QA 生成最大进程,结合数据库性能和 key 来设置
"pgIvfflatProbe": 20 // pg vector 搜索探针。没有设置索引前可忽略,通常 50w 组以上才需要设置。
Expand All @@ -61,7 +60,6 @@ weight: 751
"scripts": []
},
"SystemParams": {
"gitLoginSecret": "",
"vectorMaxProcess": 15,
"qaMaxProcess": 15,
"pgIvfflatProbe": 20
Expand Down
1 change: 0 additions & 1 deletion files/deploy/fastgpt/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"scripts": []
},
"SystemParams": {
"gitLoginSecret": "",
"vectorMaxProcess": 15,
"qaMaxProcess": 15,
"pgIvfflatProbe": 20
Expand Down

0 comments on commit 42fec3a

Please sign in to comment.