From 586372f4c57b2713b97bb1744a9d2fcfcf4ad48f Mon Sep 17 00:00:00 2001 From: Gavan <994259213@qq.com> Date: Mon, 14 Jul 2025 14:50:14 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BF=AE=E6=94=B9=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/pages/auth/index.tsx | 6 ++++-- ui/src/pages/invite/index.tsx | 6 ++++-- ui/src/pages/user/login/index.tsx | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) 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 = () => (