Skip to content

Commit 15d4eec

Browse files
committed
UI: callback 优化
1 parent 5a2abcd commit 15d4eec

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

src/pages/IdentityProvider/Create/CallbackURL.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import React from 'react';
2+
import { Typography } from 'antd';
23
import { useIntl } from '@umijs/max';
34
import { getRedirectURL } from '@/services/system/oauth';
45
import { ProFormDependency, ProFormText } from '@ant-design/pro-components';
56

7+
const { Paragraph } = Typography;
8+
69
const INTL = {
710
NAME: {
811
id: 'idp.form.name',
@@ -24,8 +27,22 @@ export const CallbackURL = () => {
2427
width="xl"
2528
label={intl.formatMessage(INTL.AUTH_URL)}
2629
name={['config', 'redirectURL']}
27-
allowClear={false}
30+
readonly
31+
fieldProps={{ autoComplete: 'off' }}
2832
initialValue={redirectURL}
33+
proFieldProps={{
34+
render: () => {
35+
return (
36+
<Paragraph copyable={{ text: redirectURL }} style={{ marginBottom: '0' }}>
37+
<span
38+
dangerouslySetInnerHTML={{
39+
__html: `<span>${redirectURL}</span>`,
40+
}}
41+
/>
42+
</Paragraph>
43+
);
44+
},
45+
}}
2946
></ProFormText>
3047
);
3148
}}

src/pages/IdentityProvider/Create/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ const INTL = {
2222
BASIC_INFO: {
2323
id: 'policy.form.title.basicInfo',
2424
},
25+
LOGIN_CONFIG: {
26+
id: 'policy.form.title.loginConfig',
27+
},
2528
NAME: {
2629
id: 'idp.form.name',
2730
},
@@ -151,6 +154,11 @@ const CreatePolicy: React.FC = () => {
151154
return null;
152155
}}
153156
</ProFormDependency>
157+
<ProForm.Group
158+
align="center"
159+
title={intl.formatMessage(INTL.LOGIN_CONFIG)}
160+
titleStyle={{ marginBottom: '14px' }}
161+
></ProForm.Group>
154162
</ProForm>
155163
</ProCard>
156164
</PageContainer>

src/pages/Policy/locales/zh-CN.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default {
2525
'policy.type.allowAll': '全部操作',
2626
'policy.type.specific': '特定操作',
2727
'policy.form.title.basicInfo': '基本信息',
28+
'policy.form.title.loginConfig': '登录配置',
2829
'policy.form.title.subjectInfo': '授权主体',
2930
'policy.form.placeholder.api': '请输入请求接口',
3031
'policy.form.placeholder.method': '请输入请求方法',

0 commit comments

Comments
 (0)