feat: react前端应用管理增加“令牌类型”配置

This commit is contained in:
zlt2000
2023-12-13 22:33:28 +08:00
parent 99c2b90aa2
commit 024ad936f4
5 changed files with 18 additions and 60 deletions
@@ -27,8 +27,7 @@ const UpdateForm: React.FC<CreateFormProps> = (props) => {
autoapprove: 'true', autoapprove: 'true',
accessTokenValiditySeconds: '18000', accessTokenValiditySeconds: '18000',
refreshTokenValiditySeconds: '28800', refreshTokenValiditySeconds: '28800',
supportIdToken: 'true', tokenFormat: 'reference',
idTokenValiditySeconds: '60',
authorizedGrantTypeCodes: authorizedGrantTypeCodes:
'authorization_code,password,client_credentials,implicit,refresh_token,password_code,openId,mobile_password'.split(","), 'authorization_code,password,client_credentials,implicit,refresh_token,password_code,openId,mobile_password'.split(","),
}} }}
@@ -172,39 +171,21 @@ const UpdateForm: React.FC<CreateFormProps> = (props) => {
fieldProps={{suffix:'秒'}} fieldProps={{suffix:'秒'}}
/> />
<ProFormRadio.Group <ProFormRadio.Group
name="supportIdToken" name="tokenFormat"
label="支持ID令牌" label="令牌类型"
width="md" width="md"
colProps={{ span: 12 }} colProps={{ span: 12 }}
options={[ options={[
{ {
label: '是', label: '引用令牌(不透明)',
value: true, value: 'reference',
}, },
{ {
label: '否', label: '自包含令牌(jwt)',
value: false, value: 'self-contained',
}, },
]} ]}
/> />
<ProFormText
rules={[
{
required: true,
message: 'ID时效不为空',
},
{
pattern: new RegExp(/^[1-9]\d*$/, 'g'),
message: 'ID时效必须为整数',
},
]}
width="md"
colProps={{ span: 12 }}
name="idTokenValiditySeconds"
label="ID时效(s)"
placeholder="输入ID时效"
fieldProps={{suffix:'秒'}}
/>
</ProForm.Group> </ProForm.Group>
</ModalForm> </ModalForm>
); );
@@ -162,39 +162,21 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
fieldProps={{suffix:'秒'}} fieldProps={{suffix:'秒'}}
/> />
<ProFormRadio.Group <ProFormRadio.Group
name="supportIdToken" name="tokenFormat"
label="支持ID令牌" label="令牌类型"
width="md" width="md"
colProps={{ span: 12 }} colProps={{ span: 12 }}
options={[ options={[
{ {
label: '是', label: '引用令牌(不透明)',
value: true, value: 'reference',
}, },
{ {
label: '否', label: '自包含令牌(jwt)',
value: false, value: 'self-contained',
}, },
]} ]}
/> />
<ProFormText
rules={[
{
required: true,
message: 'ID时效不为空',
},
{
pattern: new RegExp(/^[1-9]\d*$/, 'g'),
message: 'ID时效必须为整数',
},
]}
width="md"
colProps={{ span: 12 }}
name="idTokenValiditySeconds"
label="ID时效(s)"
placeholder="输入ID时效"
fieldProps={{suffix:'秒'}}
/>
</ProForm.Group> </ProForm.Group>
</ModalForm> </ModalForm>
); );
@@ -118,17 +118,11 @@ const TableList: React.FC = () => {
width: 40, width: 40,
}, },
{ {
title: '支持ID令牌', title: '令牌类型',
key: 'supportIdToken', key: 'tokenFormat',
width: 40, width: 40,
align: 'center', align: 'center',
renderText: (_, record) => (record.supportIdToken ? '是' : '否'), renderText: (_, record) => (record.tokenFormat == 'reference' ? '引用令牌' : '自包含令牌'),
},
{
title: 'ID时效',
dataIndex: 'idTokenValiditySeconds',
valueType: 'second',
width: 40,
}, },
{ {
title: '操作', title: '操作',
@@ -56,6 +56,7 @@ const TableList: React.FC = () => {
{ {
title: 'token', title: 'token',
dataIndex: 'tokenValue', dataIndex: 'tokenValue',
width: 120,
}, },
{ {
title: '到期时间', title: '到期时间',
@@ -76,7 +76,7 @@ declare namespace SYSTEM {
refreshTokenValiditySeconds?: number; refreshTokenValiditySeconds?: number;
resourceIds?: string; resourceIds?: string;
scope?: string; scope?: string;
supportIdToken?: boolean; tokenFormat?: string;
updateTime?: Date; updateTime?: Date;
webServerRedirectUri?: string; webServerRedirectUri?: string;
}; };