oidc登录按钮支持自定义文字

This commit is contained in:
mtvpls
2025-12-13 17:36:57 +08:00
parent 822bb4a07e
commit d467c5067b
6 changed files with 34 additions and 3 deletions
+25
View File
@@ -311,6 +311,7 @@ interface SiteConfig {
OIDCUserInfoEndpoint?: string;
OIDCClientId?: string;
OIDCClientSecret?: string;
OIDCButtonText?: string;
}
// 视频源数据类型
@@ -4605,6 +4606,7 @@ const SiteConfigComponent = ({
OIDCUserInfoEndpoint: '',
OIDCClientId: '',
OIDCClientSecret: '',
OIDCButtonText: '',
});
// 豆瓣数据源相关状态
@@ -4686,6 +4688,7 @@ const SiteConfigComponent = ({
OIDCUserInfoEndpoint: config.SiteConfig.OIDCUserInfoEndpoint || '',
OIDCClientId: config.SiteConfig.OIDCClientId || '',
OIDCClientSecret: config.SiteConfig.OIDCClientSecret || '',
OIDCButtonText: config.SiteConfig.OIDCButtonText || '',
});
}
}, [config]);
@@ -5721,6 +5724,28 @@ const SiteConfigComponent = ({
SITE_BASEOIDC提供商KeycloakAuth0等URI
</p>
</div>
{/* OIDC登录按钮文字 */}
<div>
<label className='block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2'>
OIDC登录按钮文字
</label>
<input
type='text'
placeholder='使用OIDC登录'
value={siteSettings.OIDCButtonText || ''}
onChange={(e) =>
setSiteSettings((prev) => ({
...prev,
OIDCButtonText: e.target.value,
}))
}
className='w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-green-500 focus:border-transparent'
/>
<p className='mt-1 text-xs text-gray-500 dark:text-gray-400'>
OIDC登录按钮显示的文字"使用企业账号登录""使用SSO登录""使用OIDC登录"
</p>
</div>
</div>
{/* 操作按钮 */}