add baidu keywords (#3127)

This commit is contained in:
heheer
2024-11-12 16:44:09 +08:00
committed by GitHub
parent 2e1bf66d3d
commit 2c5f88b85f
7 changed files with 35 additions and 6 deletions

View File

@@ -71,7 +71,8 @@ const FormLayout = ({ children, setPageType, pageType }: Props) => {
: [])
];
const show_oauth = !!(feConfigs?.sso || oAuthList.length > 0);
const show_oauth =
!sessionStorage.getItem('bd_vid') && !!(feConfigs?.sso || oAuthList.length > 0);
return (
<Flex flexDirection={'column'} h={'100%'}>

View File

@@ -45,13 +45,24 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
const { runAsync: onclickRegister, loading: requesting } = useRequest2(
async ({ username, password, code }: RegisterType) => {
const fastgpt_sem = (() => {
try {
return sessionStorage.getItem('fastgpt_sem')
? JSON.parse(sessionStorage.getItem('fastgpt_sem')!)
: undefined;
} catch {
return undefined;
}
})();
loginSuccess(
await postRegister({
username,
code,
password,
inviterId: localStorage.getItem('inviterId') || undefined,
bd_vid: localStorage.getItem('bd_vid') || undefined
bd_vid: sessionStorage.getItem('bd_vid') || undefined,
fastgpt_sem: fastgpt_sem
})
);

View File

@@ -86,6 +86,11 @@ const Login = ({ ChineseRedirectUrl }: { ChineseRedirectUrl: string }) => {
/* default login type */
useEffect(() => {
const bd_vid = sessionStorage.getItem('bd_vid');
if (bd_vid) {
setPageType(LoginPageTypeEnum.passwordLogin);
return;
}
setPageType(
feConfigs?.oauth?.wechat ? LoginPageTypeEnum.wechat : LoginPageTypeEnum.passwordLogin
);