diff --git a/backend/apps/system/api/user.py b/backend/apps/system/api/user.py index 119314896..43ec5577d 100644 --- a/backend/apps/system/api/user.py +++ b/backend/apps/system/api/user.py @@ -48,6 +48,8 @@ async def pager( if oidlist: origin_stmt = origin_stmt.where(UserWsModel.oid.in_(oidlist)) + if origins: + origin_stmt = origin_stmt.where(UserModel.origin.in_(origins)) if status is not None: origin_stmt = origin_stmt.where(UserModel.status == status) if keyword: diff --git a/frontend/src/views/system/user/User.vue b/frontend/src/views/system/user/User.vue index 6f134a2af..8e3c36b0c 100644 --- a/frontend/src/views/system/user/User.vue +++ b/frontend/src/views/system/user/User.vue @@ -76,7 +76,11 @@ - + + + ([ type: 'enum', option: [ { id: '0', name: t('user.local_creation') }, - // { id: 1, name: 'LDAP' }, - // { id: 2, name: 'OIDC' }, - // { id: 3, name: 'CAS' }, - // { id: 9, name: 'OAuth2' }, - // { id: 4, name: t('user.feishu') }, - // { id: 5, name: t('user.dingtalk') }, - // { id: 6, name: t('user.wechat_for_business') }, + { id: '1', name: 'CAS' }, + { id: '2', name: 'OIDC' }, + { id: '3', name: 'LDAP' }, + { id: '4', name: 'OAuth2' }, + { id: '5', name: 'SAML2' }, ], field: 'origins', title: t('user.user_source'), @@ -824,6 +826,13 @@ const loadDefaultPwd = () => { } }) } +const formatUserOrigin = (origin?: number) => { + if (!origin) { + return t('user.local_creation') + } + const originArray = ['CAS', 'OIDC', 'LDAP', 'OAuth2', 'SAML2'] + return originArray[origin - 1] +} onMounted(() => { workspaceList().then((res) => { options.value = res || []