mirror of https://gitee.com/topiam/eiam
⚡ OIDC 协议页面配置优化
parent
deb27bace3
commit
a19aa9303a
|
@ -75,7 +75,6 @@ export default (props: { app: GetApp | Record<string, any> }) => {
|
||||||
const { id, template } = app;
|
const { id, template } = app;
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [protocolEndpoint, setProtocolEndpoint] = useState<Record<string, string>>({});
|
const [protocolEndpoint, setProtocolEndpoint] = useState<Record<string, string>>({});
|
||||||
const [idTokenCustomClaimsTableForm] = Form.useForm();
|
|
||||||
const [loading, setLoading] = useState<boolean>(true);
|
const [loading, setLoading] = useState<boolean>(true);
|
||||||
|
|
||||||
useMount(async () => {
|
useMount(async () => {
|
||||||
|
@ -127,8 +126,6 @@ export default (props: { app: GetApp | Record<string, any> }) => {
|
||||||
form={form}
|
form={form}
|
||||||
scrollToFirstError
|
scrollToFirstError
|
||||||
onFinish={async (values) => {
|
onFinish={async (values) => {
|
||||||
//校验扩展字段
|
|
||||||
await idTokenCustomClaimsTableForm.validateFields();
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const { success } = await saveAppConfig({
|
const { success } = await saveAppConfig({
|
||||||
id,
|
id,
|
||||||
|
@ -269,9 +266,17 @@ export default (props: { app: GetApp | Record<string, any> }) => {
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</ProFormDependency>
|
</ProFormDependency>
|
||||||
|
<ProFormDependency name={['authGrantTypes']}>
|
||||||
|
{({ authGrantTypes }) => {
|
||||||
|
const required =
|
||||||
|
authGrantTypes?.includes('implicit') ||
|
||||||
|
authGrantTypes?.includes('authorization_code');
|
||||||
|
return (
|
||||||
<Form.List
|
<Form.List
|
||||||
name="redirectUris"
|
name="redirectUris"
|
||||||
rules={[
|
rules={
|
||||||
|
required
|
||||||
|
? [
|
||||||
{
|
{
|
||||||
validator: async (_, value) => {
|
validator: async (_, value) => {
|
||||||
if (value && value.length > 0) {
|
if (value && value.length > 0) {
|
||||||
|
@ -286,14 +291,15 @@ export default (props: { app: GetApp | Record<string, any> }) => {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]}
|
]
|
||||||
|
: []
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{(fields, { add, remove }, { errors }) => (
|
{(fields, { add, remove }, { errors }) => (
|
||||||
<>
|
<>
|
||||||
{fields.map(({ key, name, ...restField }, index) => (
|
{fields.map(({ key, name, ...restField }, index) => (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
{...(index === 0 ? layout : formItemLayoutWithOutLabel)}
|
{...(index === 0 ? layout : formItemLayoutWithOutLabel)}
|
||||||
required={true}
|
|
||||||
key={key}
|
key={key}
|
||||||
label={
|
label={
|
||||||
index === 0
|
index === 0
|
||||||
|
@ -314,7 +320,9 @@ export default (props: { app: GetApp | Record<string, any> }) => {
|
||||||
{...restField}
|
{...restField}
|
||||||
name={[name]}
|
name={[name]}
|
||||||
validateTrigger={['onChange', 'onBlur']}
|
validateTrigger={['onChange', 'onBlur']}
|
||||||
rules={[
|
rules={
|
||||||
|
required
|
||||||
|
? [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: intl.formatMessage({
|
message: intl.formatMessage({
|
||||||
|
@ -327,7 +335,16 @@ export default (props: { app: GetApp | Record<string, any> }) => {
|
||||||
id: 'pages.app.config.detail.protocol_config.oidc.redirect_uris.rule.1.message',
|
id: 'pages.app.config.detail.protocol_config.oidc.redirect_uris.rule.1.message',
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
]}
|
]
|
||||||
|
: [
|
||||||
|
{
|
||||||
|
type: 'url',
|
||||||
|
message: intl.formatMessage({
|
||||||
|
id: 'pages.app.config.detail.protocol_config.oidc.redirect_uris.rule.1.message',
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
noStyle
|
noStyle
|
||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
|
@ -342,7 +359,7 @@ export default (props: { app: GetApp | Record<string, any> }) => {
|
||||||
))}
|
))}
|
||||||
<Form.Item
|
<Form.Item
|
||||||
{...(fields.length === 0 ? layout : formItemLayoutWithOutLabel)}
|
{...(fields.length === 0 ? layout : formItemLayoutWithOutLabel)}
|
||||||
required={true}
|
required={required}
|
||||||
label={
|
label={
|
||||||
fields.length === 0
|
fields.length === 0
|
||||||
? intl.formatMessage({
|
? intl.formatMessage({
|
||||||
|
@ -367,6 +384,9 @@ export default (props: { app: GetApp | Record<string, any> }) => {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Form.List>
|
</Form.List>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</ProFormDependency>
|
||||||
<Form.List name="postLogoutRedirectUris">
|
<Form.List name="postLogoutRedirectUris">
|
||||||
{(fields, { add, remove }, {}) => (
|
{(fields, { add, remove }, {}) => (
|
||||||
<>
|
<>
|
||||||
|
|
Loading…
Reference in New Issue