diff --git a/eiam-application/eiam-application-form/src/main/java/cn/topiam/employee/application/form/model/FormProtocolConfig.java b/eiam-application/eiam-application-form/src/main/java/cn/topiam/employee/application/form/model/FormProtocolConfig.java index 48a6fd45..be7cbcae 100644 --- a/eiam-application/eiam-application-form/src/main/java/cn/topiam/employee/application/form/model/FormProtocolConfig.java +++ b/eiam-application/eiam-application-form/src/main/java/cn/topiam/employee/application/form/model/FormProtocolConfig.java @@ -28,6 +28,7 @@ import cn.topiam.employee.common.enums.app.FormSubmitType; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; /** * Form 协议配置 @@ -38,6 +39,7 @@ import lombok.experimental.SuperBuilder; @EqualsAndHashCode(callSuper = true) @Data @SuperBuilder +@Jacksonized public class FormProtocolConfig extends AbstractProtocolConfig { @Serial diff --git a/eiam-application/eiam-application-jwt/src/main/java/cn/topiam/employee/application/jwt/model/JwtProtocolConfig.java b/eiam-application/eiam-application-jwt/src/main/java/cn/topiam/employee/application/jwt/model/JwtProtocolConfig.java index 5ea8e055..9002818f 100644 --- a/eiam-application/eiam-application-jwt/src/main/java/cn/topiam/employee/application/jwt/model/JwtProtocolConfig.java +++ b/eiam-application/eiam-application-jwt/src/main/java/cn/topiam/employee/application/jwt/model/JwtProtocolConfig.java @@ -26,6 +26,7 @@ import cn.topiam.employee.common.enums.app.JwtIdTokenSubjectType; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; /** * Form 协议配置 @@ -36,6 +37,7 @@ import lombok.experimental.SuperBuilder; @EqualsAndHashCode(callSuper = true) @Data @SuperBuilder +@Jacksonized public class JwtProtocolConfig extends AbstractProtocolConfig { @Serial diff --git a/eiam-application/eiam-application-oidc/src/main/java/cn/topiam/employee/application/oidc/model/OidcProtocolConfig.java b/eiam-application/eiam-application-oidc/src/main/java/cn/topiam/employee/application/oidc/model/OidcProtocolConfig.java index 6d9850de..510a2624 100644 --- a/eiam-application/eiam-application-oidc/src/main/java/cn/topiam/employee/application/oidc/model/OidcProtocolConfig.java +++ b/eiam-application/eiam-application-oidc/src/main/java/cn/topiam/employee/application/oidc/model/OidcProtocolConfig.java @@ -28,6 +28,7 @@ import cn.topiam.employee.application.AbstractProtocolConfig; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; /** * Oidc 协议配置 @@ -38,6 +39,7 @@ import lombok.experimental.SuperBuilder; @EqualsAndHashCode(callSuper = true) @Data @SuperBuilder +@Jacksonized public class OidcProtocolConfig extends AbstractProtocolConfig { @Serial diff --git a/eiam-console/src/main/console-fe/src/pages/account/IdentitySourceDetail/service.ts b/eiam-console/src/main/console-fe/src/pages/account/IdentitySourceDetail/service.ts index 8169db4e..09e77c1b 100644 --- a/eiam-console/src/main/console-fe/src/pages/account/IdentitySourceDetail/service.ts +++ b/eiam-console/src/main/console-fe/src/pages/account/IdentitySourceDetail/service.ts @@ -16,7 +16,6 @@ * along with this program. If not, see . */ import { SortOrder } from 'antd/es/table/interface'; -import { ReactText } from 'react'; import { RequestData } from '@ant-design/pro-components'; import { request } from '@@/exports'; import { filterParamConverter, sortParamConverter } from '@/utils/utils'; @@ -92,7 +91,7 @@ export async function identitySourceConfigValidator(data: { export async function getIdentitySourceSyncHistoryList( params: Record, sort: Record, - filter: Record, + filter: Record, ): Promise> { return request(`/api/v1/identity_source/sync/history_list`, { params: { ...params, ...sortParamConverter(sort), ...filterParamConverter(filter) }, @@ -112,7 +111,7 @@ export async function getIdentitySourceSyncHistoryList( export async function getIdentitySourceSyncRecordList( params: Record, sort: Record, - filter: Record, + filter: Record, ): Promise> { return request(`/api/v1/identity_source/sync/record_list`, { params: { ...params, ...sortParamConverter(sort), ...filterParamConverter(filter) }, @@ -132,7 +131,7 @@ export async function getIdentitySourceSyncRecordList( export async function getIdentitySourceEventRecordList( params: Record, sort: Record, - filter: Record, + filter: Record, ): Promise> { return request(`/api/v1/identity_source/event/record_list`, { params: { ...params, ...sortParamConverter(sort), ...filterParamConverter(filter) }, diff --git a/eiam-console/src/main/console-fe/src/pages/account/IdentitySourceList/service.ts b/eiam-console/src/main/console-fe/src/pages/account/IdentitySourceList/service.ts index 23d10eca..af25d759 100644 --- a/eiam-console/src/main/console-fe/src/pages/account/IdentitySourceList/service.ts +++ b/eiam-console/src/main/console-fe/src/pages/account/IdentitySourceList/service.ts @@ -16,7 +16,6 @@ * along with this program. If not, see . */ import { SortOrder } from 'antd/es/table/interface'; -import { ReactText } from 'react'; import { RequestData } from '@ant-design/pro-components'; import { request } from '@@/exports'; import { filterParamConverter, sortParamConverter } from '@/utils/utils'; @@ -27,7 +26,7 @@ import { filterParamConverter, sortParamConverter } from '@/utils/utils'; export async function getIdentityProviderList( params: Record, sort: Record, - filter: Record, + filter: Record, ): Promise> { return request>('/api/v1/identity_source/list', { params: { ...params, ...sortParamConverter(sort), ...filterParamConverter(filter) }, diff --git a/eiam-console/src/main/console-fe/src/pages/account/UserDetail/components/AppAccount/AppAccount.tsx b/eiam-console/src/main/console-fe/src/pages/account/UserDetail/components/AppAccount/AppAccount.tsx index e0815b60..e8174a35 100644 --- a/eiam-console/src/main/console-fe/src/pages/account/UserDetail/components/AppAccount/AppAccount.tsx +++ b/eiam-console/src/main/console-fe/src/pages/account/UserDetail/components/AppAccount/AppAccount.tsx @@ -21,7 +21,7 @@ import { QuestionCircleOutlined } from '@ant-design/icons'; import type { ActionType, ProColumns } from '@ant-design/pro-components'; import { ProTable } from '@ant-design/pro-components'; -import { Badge, App, Popconfirm, Table } from 'antd'; +import { App, Badge, Popconfirm, Table } from 'antd'; import { useRef } from 'react'; import { useIntl } from '@umijs/max'; diff --git a/eiam-console/src/main/console-fe/src/pages/account/UserDetail/components/UserInfo/UserInfo.tsx b/eiam-console/src/main/console-fe/src/pages/account/UserDetail/components/UserInfo/UserInfo.tsx index bfc279a2..c1841660 100644 --- a/eiam-console/src/main/console-fe/src/pages/account/UserDetail/components/UserInfo/UserInfo.tsx +++ b/eiam-console/src/main/console-fe/src/pages/account/UserDetail/components/UserInfo/UserInfo.tsx @@ -15,7 +15,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import { Avatar, Image, App, Popconfirm, Skeleton } from 'antd'; +import { App, Avatar, Image, Popconfirm, Skeleton } from 'antd'; import { ActionType, ProCard, diff --git a/eiam-console/src/main/console-fe/src/pages/account/UserGroupDetail/UserGroupDetail.tsx b/eiam-console/src/main/console-fe/src/pages/account/UserGroupDetail/UserGroupDetail.tsx index ef1ecbb8..8cd23ffa 100644 --- a/eiam-console/src/main/console-fe/src/pages/account/UserGroupDetail/UserGroupDetail.tsx +++ b/eiam-console/src/main/console-fe/src/pages/account/UserGroupDetail/UserGroupDetail.tsx @@ -15,31 +15,31 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -import {getUserGroup, updateUserGroup} from '@/services/account'; -import {history} from '@@/core/history'; +import { getUserGroup, updateUserGroup } from '@/services/account'; +import { history } from '@@/core/history'; -import {PageContainer, ProDescriptions, RouteContext} from '@ant-design/pro-components'; -import {useAsyncEffect, useMount} from 'ahooks'; -import {App, Skeleton} from 'antd'; -import {useState} from 'react'; +import { PageContainer, ProDescriptions, RouteContext } from '@ant-design/pro-components'; +import { useAsyncEffect, useMount } from 'ahooks'; +import { App, Skeleton } from 'antd'; +import { useState } from 'react'; import MemberList from './components/MemberList'; -import {UserGroupDetailTabs} from './constant'; +import { UserGroupDetailTabs } from './constant'; import queryString from 'query-string'; -import {useIntl, useLocation} from '@umijs/max'; -import useStyles from "./style"; -import AccessStrategy from "@/pages/account/UserGroupDetail/components/AccessStrategy"; +import { useIntl, useLocation } from '@umijs/max'; +import useStyles from './style'; +import AccessStrategy from '@/pages/account/UserGroupDetail/components/AccessStrategy'; /** * 用户组详情 */ export default () => { const intl = useIntl(); - const {styles} = useStyles(); - const {message} = App.useApp(); + const { styles } = useStyles(); + const { message } = App.useApp(); const location = useLocation(); const query = queryString.parse(location.search); - const {id} = query as { id: string }; - const {type} = query as { + const { id } = query as { id: string }; + const { type } = query as { type: UserGroupDetailTabs; }; @@ -50,7 +50,7 @@ export default () => { useMount(() => { if (!id) { message - .warning(intl.formatMessage({id: 'pages.account.user_group_detail.use_mount.message'})) + .warning(intl.formatMessage({ id: 'pages.account.user_group_detail.use_mount.message' })) .then(); history.push(`/account/user-group`); return; @@ -59,7 +59,7 @@ export default () => { setTabActiveKey(UserGroupDetailTabs.member); history.push({ pathname: location.pathname, - search: queryString.stringify({type: UserGroupDetailTabs.member, id: id}), + search: queryString.stringify({ type: UserGroupDetailTabs.member, id: id }), }); return; } @@ -69,7 +69,7 @@ export default () => { useAsyncEffect(async () => { if (id) { setLoading(true); - const {success, result} = await getUserGroup(id); + const { success, result } = await getUserGroup(id); if (success) { setDetail(result); setLoading(false); @@ -80,9 +80,9 @@ export default () => { const description = ( - {({isMobile}) => + {({ isMobile }) => loading ? ( - + ) : ( > size="small" @@ -91,17 +91,17 @@ export default () => { editable={{ onSave: async (key, record) => { let success: boolean; - const result = await updateUserGroup({...record}); + const result = await updateUserGroup({ ...record }); success = result.success; if (success) { - message.success(intl.formatMessage({id: 'app.operation_success'})); - setDetail({...record}); + message.success(intl.formatMessage({ id: 'app.operation_success' })); + setDetail({ ...record }); return Promise.resolve(true); } return Promise.resolve(false); }, }} - dataSource={{...detail}} + dataSource={{ ...detail }} > { className={styles.descriptionRemark} dataIndex="remark" valueType={'textarea'} - fieldProps={{rows: 2, maxLength: 20}} + fieldProps={{ rows: 2, maxLength: 20 }} /> ) @@ -139,13 +139,13 @@ export default () => { history.push('/account/user-group'); }} title={ - loading ? : detail?.name + loading ? : detail?.name } content={<>{description}} tabList={[ { key: UserGroupDetailTabs.member, - tab: intl.formatMessage({id: 'pages.account.user_group_detail.tab_list.member'}), + tab: intl.formatMessage({ id: 'pages.account.user_group_detail.tab_list.member' }), }, { key: UserGroupDetailTabs.access_policy, @@ -159,14 +159,14 @@ export default () => { setTabActiveKey(key); history.replace({ pathname: location.pathname, - search: queryString.stringify({id, type: key}), + search: queryString.stringify({ id, type: key }), }); }} > {/*成员信息*/} - {type === UserGroupDetailTabs.member && } + {type === UserGroupDetailTabs.member && } {/*授权应用*/} - {type === UserGroupDetailTabs.access_policy && } + {type === UserGroupDetailTabs.access_policy && } ); }; diff --git a/eiam-console/src/main/console-fe/src/pages/account/UserGroupDetail/components/MemberList/MemberList.tsx b/eiam-console/src/main/console-fe/src/pages/account/UserGroupDetail/components/MemberList/MemberList.tsx index 71e2d7d0..0a135caa 100644 --- a/eiam-console/src/main/console-fe/src/pages/account/UserGroupDetail/components/MemberList/MemberList.tsx +++ b/eiam-console/src/main/console-fe/src/pages/account/UserGroupDetail/components/MemberList/MemberList.tsx @@ -48,7 +48,9 @@ export default (props: { id: string }) => { */ const columns: ProColumns[] = [ { - title: intl.formatMessage({ id: 'pages.account.user_group_detail.add_member.columns.full_name' }), + title: intl.formatMessage({ + id: 'pages.account.user_group_detail.add_member.columns.full_name', + }), dataIndex: 'fullName', fixed: 'left', ellipsis: true, diff --git a/eiam-console/src/main/console-fe/src/pages/account/UserList/components/CreateUser/index.tsx b/eiam-console/src/main/console-fe/src/pages/account/UserList/components/CreateUser/index.tsx index b8d21ccc..c081d897 100644 --- a/eiam-console/src/main/console-fe/src/pages/account/UserList/components/CreateUser/index.tsx +++ b/eiam-console/src/main/console-fe/src/pages/account/UserList/components/CreateUser/index.tsx @@ -16,4 +16,5 @@ * along with this program. If not, see . */ import CreateUser from './CreateUser'; + export default CreateUser; diff --git a/eiam-console/src/main/console-fe/src/pages/account/UserList/components/UpdateUser/UpdateUser.tsx b/eiam-console/src/main/console-fe/src/pages/account/UserList/components/UpdateUser/UpdateUser.tsx index 34e92ef2..9dc91c65 100644 --- a/eiam-console/src/main/console-fe/src/pages/account/UserList/components/UpdateUser/UpdateUser.tsx +++ b/eiam-console/src/main/console-fe/src/pages/account/UserList/components/UpdateUser/UpdateUser.tsx @@ -134,7 +134,7 @@ const UpdateUser = (props: UpdateFormProps) => { if (values.phone) { params = { ...params, phone: `${values.phoneAreaCode}${values.phone}` }; } - if (values.expireDate){ + if (values.expireDate) { params = { ...params, expireDate: dayjs(values.expireDate).format('YYYY-MM-DD') }; } const { success, result } = await updateUser(params).finally(() => { diff --git a/eiam-console/src/main/console-fe/src/pages/account/UserList/components/UpdateUser/index.tsx b/eiam-console/src/main/console-fe/src/pages/account/UserList/components/UpdateUser/index.tsx index de5be18f..6b2f119b 100644 --- a/eiam-console/src/main/console-fe/src/pages/account/UserList/components/UpdateUser/index.tsx +++ b/eiam-console/src/main/console-fe/src/pages/account/UserList/components/UpdateUser/index.tsx @@ -16,4 +16,5 @@ * along with this program. If not, see . */ import UpdateUser from './UpdateUser'; + export default UpdateUser; diff --git a/eiam-console/src/main/console-fe/src/pages/app/AppConfig/AppConfig.tsx b/eiam-console/src/main/console-fe/src/pages/app/AppConfig/AppConfig.tsx index 9234b5ae..f8b2faff 100644 --- a/eiam-console/src/main/console-fe/src/pages/app/AppConfig/AppConfig.tsx +++ b/eiam-console/src/main/console-fe/src/pages/app/AppConfig/AppConfig.tsx @@ -20,7 +20,7 @@ import { DesktopOutlined, ProfileOutlined } from '@ant-design/icons'; import { GridContent, PageContainer } from '@ant-design/pro-components'; import { useAsyncEffect } from 'ahooks'; import type { MenuProps } from 'antd'; -import { Menu, App } from 'antd'; +import { App, Menu } from 'antd'; import React, { useLayoutEffect, useRef, useState } from 'react'; import AccessPolicy from './components/AccessPolicy'; import AppAccount from './components/AppAccount'; diff --git a/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AccessPolicy/AppAccessPolicy.tsx b/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AccessPolicy/AppAccessPolicy.tsx index 2e90ce14..0cf2820c 100644 --- a/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AccessPolicy/AppAccessPolicy.tsx +++ b/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AccessPolicy/AppAccessPolicy.tsx @@ -34,10 +34,11 @@ import { ProTable, } from '@ant-design/pro-components'; -import { Button, Form, App, Popconfirm, Table } from 'antd'; -import { useRef, useState } from 'react'; +import { App, Button, Form, Popconfirm, Table } from 'antd'; import * as React from 'react'; +import { useRef, useState } from 'react'; import { useIntl } from '@umijs/max'; + /** * 添加授权 * diff --git a/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppAccount/AppAccount.tsx b/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppAccount/AppAccount.tsx index b3d221de..4912c0cb 100644 --- a/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppAccount/AppAccount.tsx +++ b/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppAccount/AppAccount.tsx @@ -21,7 +21,7 @@ import { PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons'; import type { ActionType, ProColumns } from '@ant-design/pro-components'; import { ModalForm, ProFormText, ProTable } from '@ant-design/pro-components'; -import { Alert, Button, Form, App, Popconfirm, Table } from 'antd'; +import { Alert, App, Button, Form, Popconfirm, Table } from 'antd'; import { useRef } from 'react'; import { AppProtocolType } from '@/constant'; import { Base64 } from 'js-base64'; diff --git a/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppProtocol/CommonConfig/AuthorizationType.tsx b/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppProtocol/CommonConfig/AuthorizationType.tsx index 3e967bda..a7900bc4 100644 --- a/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppProtocol/CommonConfig/AuthorizationType.tsx +++ b/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppProtocol/CommonConfig/AuthorizationType.tsx @@ -18,6 +18,7 @@ import { SsoScope } from '@/pages/app/AppConfig/constant'; import { ProFormSelect } from '@ant-design/pro-components'; import { useIntl } from '@@/exports'; + /** * 授权类型组件 * diff --git a/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppProtocol/FromProtocolConfig/FromProtocolConfig.tsx b/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppProtocol/FromProtocolConfig/FromProtocolConfig.tsx index 0aed6285..5154c790 100644 --- a/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppProtocol/FromProtocolConfig/FromProtocolConfig.tsx +++ b/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppProtocol/FromProtocolConfig/FromProtocolConfig.tsx @@ -17,7 +17,7 @@ */ import { getAppConfig, saveAppConfig } from '@/services/app'; import { useAsyncEffect } from 'ahooks'; -import { Alert, Divider, Form, App, Spin } from 'antd'; +import { Alert, App, Divider, Form, Spin } from 'antd'; import React, { useState } from 'react'; import { EditableProTable, @@ -36,6 +36,7 @@ import { useIntl } from '@umijs/max'; import { AuthorizationType } from '../CommonConfig'; import { GetApp } from '../../../data.d'; import { generateUUID } from '@/utils/utils'; + const formItemLayout = { labelCol: { span: 6, diff --git a/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppProtocol/JwtProtocolConfig/JwtProtocolConfig.tsx b/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppProtocol/JwtProtocolConfig/JwtProtocolConfig.tsx index 2819b320..d1fbd418 100644 --- a/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppProtocol/JwtProtocolConfig/JwtProtocolConfig.tsx +++ b/eiam-console/src/main/console-fe/src/pages/app/AppConfig/components/AppProtocol/JwtProtocolConfig/JwtProtocolConfig.tsx @@ -17,7 +17,7 @@ */ import { getAppConfig, saveAppConfig } from '@/services/app'; import { useAsyncEffect } from 'ahooks'; -import { Divider, Form, App, Spin, Alert } from 'antd'; +import { Alert, App, Divider, Form, Spin } from 'antd'; import React, { useState } from 'react'; import { FooterToolbar, @@ -32,6 +32,7 @@ import { omit } from 'lodash'; import { useIntl } from '@umijs/max'; import { AuthorizationType } from '../CommonConfig'; import { GetApp } from '../../../data.d'; + const layout = { labelCol: { xs: { span: 24 }, @@ -89,7 +90,7 @@ export default (props: { app: GetApp | Record }) => { } /> -
+
}) => { form.setFieldsValue({ appId: id, ...result, - //重定向URI - redirectUris: result.redirectUris?.length > 0 ? result.redirectUris : [undefined], - //登出重定向URI - postLogoutRedirectUris: - result.postLogoutRedirectUris?.length > 0 ? result.postLogoutRedirectUris : [undefined], }); //设置Endpoint相关 setProtocolEndpoint(result.protocolEndpoint); @@ -224,7 +219,7 @@ export default (props: { app: GetApp | Record }) => { ), - } + }, ]} /> @@ -250,18 +245,20 @@ export default (props: { app: GetApp | Record }) => { { validator: async (_, value) => { if (value && value.length > 0) { - return; + return null; } - throw new Error( - intl.formatMessage({ - id: 'pages.app.config.items.login_access.protocol_config.oidc.redirect_uris.rule.0.message', - }), + return Promise.reject( + new Error( + intl.formatMessage({ + id: 'pages.app.config.items.login_access.protocol_config.oidc.redirect_uris.rule.0.message', + }), + ), ); }, }, ]} > - {(fields, { add, remove }, {}) => ( + {(fields, { add, remove }, { errors }) => ( <> {fields.map((field, index) => ( }) => { }) : '' } - extra={ - index === fields.length - 1 && - intl.formatMessage({ - id: 'pages.app.config.items.login_access.protocol_config.oidc.redirect_uris.extra', - }) - } >
}) => { })} /> - {fields.length > 1 ? ( - remove(field.name)} /> - ) : null} + remove(field.name)} />
))} - + + )} - { - if (value && value.length > 0) { - return; - } - throw new Error( - intl.formatMessage({ - id: 'pages.app.config.items.login_access.protocol_config.oidc.post_logout_redirect_uris.rule.0.message', - }), - ); - }, - }, - ]} - > + {(fields, { add, remove }, {}) => ( <> {fields.map((field, index) => { @@ -357,7 +344,6 @@ export default (props: { app: GetApp | Record }) => { }) => { }) : '' } - extra={ - index === fields.length - 1 && - intl.formatMessage({ - id: 'pages.app.config.items.login_access.protocol_config.oidc.post_logout_redirect_uris.extra', - }) - } >
}) => { })} /> - {fields.length > 1 ? ( - remove(field.name)} /> - ) : null} + remove(field.name)} />
); })} - +