diff --git a/ui/src/pages/auth/index.tsx b/ui/src/pages/auth/index.tsx index 0ce0912..e611418 100644 --- a/ui/src/pages/auth/index.tsx +++ b/ui/src/pages/auth/index.tsx @@ -178,8 +178,10 @@ const AuthPage = () => { }, []); const oauthEnable = useMemo(() => { - return custom_oauth.enable || dingtalk_oauth.enable; - }, [custom_oauth, dingtalk_oauth]); + return ( + loginSetting.custom_oauth?.enable || loginSetting.dingtalk_oauth?.enable + ); + }, [loginSetting]); // 渲染用户名输入框 const renderUsernameField = () => ( diff --git a/ui/src/pages/invite/index.tsx b/ui/src/pages/invite/index.tsx index 4613312..9dc76b7 100644 --- a/ui/src/pages/invite/index.tsx +++ b/ui/src/pages/invite/index.tsx @@ -148,8 +148,10 @@ const Invite = () => { }; const oauthEnable = useMemo(() => { - return custom_oauth.enable || dingtalk_oauth.enable; - }, [custom_oauth, dingtalk_oauth]); + return ( + loginSetting.custom_oauth?.enable || loginSetting.dingtalk_oauth?.enable + ); + }, [loginSetting]); const oauthLogin = () => { return ( diff --git a/ui/src/pages/user/login/index.tsx b/ui/src/pages/user/login/index.tsx index 0e2184a..c47141d 100644 --- a/ui/src/pages/user/login/index.tsx +++ b/ui/src/pages/user/login/index.tsx @@ -169,8 +169,10 @@ const UserLogin = () => { }, []); const oauthEnable = useMemo(() => { - return custom_oauth.enable || dingtalk_oauth.enable; - }, [custom_oauth, dingtalk_oauth]); + return ( + loginSetting.custom_oauth?.enable || loginSetting.dingtalk_oauth?.enable + ); + }, [loginSetting]); // 渲染用户名输入框 const renderUsernameField = () => (