Skip to content

Commit 21d77b3

Browse files
authored
Merge pull request #333 from yokowu/feat-oauth-enable
feat: 支持 oauth 配置
2 parents 0ebafd4 + a51f7b9 commit 21d77b3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ui/src/pages/memberManage/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { useRequest } from 'ahooks';
1212
import { getGetSetting, putUpdateSetting } from '@/api/Admin';
1313
import MemberManage from './memberManage';
1414
import LoginHistory from './loginHistory';
15+
import { DomainLicenseEdition, v1LicenseList } from '@/api';
1516
import { message } from '@c-x/ui';
1617
import ThirdPartyLoginSettingModal from './thirdPartyLoginSettingModal';
1718
import GroupList from './groupList';
@@ -52,6 +53,10 @@ const User = () => {
5253
},
5354
});
5455

56+
const license = useRequest(() => {
57+
return v1LicenseList({});
58+
}).data;
59+
5560
const oauthLabel = useMemo(() => {
5661
if (!data) return '未开启';
5762
const key = OAUTH_LOGIN_TYPE_KEYS.find(
@@ -119,9 +124,9 @@ const User = () => {
119124
color='info'
120125
sx={{ gap: 2 }}
121126
onClick={() => setThirdPartyLoginSettingModalOpen(true)}
122-
disabled
127+
disabled={license?.edition !== DomainLicenseEdition.LicenseEditionEnterprise}
123128
>
124-
配置 (敬请期待)
129+
配置
125130
</Button>
126131
</StyledCard>
127132
<LoginHistory />

0 commit comments

Comments
 (0)