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',
accessTokenValiditySeconds: '18000',
refreshTokenValiditySeconds: '28800',
supportIdToken: 'true',
idTokenValiditySeconds: '60',
tokenFormat: 'reference',
authorizedGrantTypeCodes:
'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:'秒'}}
/>
<ProFormRadio.Group
name="supportIdToken"
label="支持ID令牌"
name="tokenFormat"
label="令牌类型"
width="md"
colProps={{ span: 12 }}
options={[
{
label: '是',
value: true,
label: '引用令牌(不透明)',
value: 'reference',
},
{
label: '否',
value: false,
label: '自包含令牌(jwt)',
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>
</ModalForm>
);
@@ -162,39 +162,21 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
fieldProps={{suffix:'秒'}}
/>
<ProFormRadio.Group
name="supportIdToken"
label="支持ID令牌"
name="tokenFormat"
label="令牌类型"
width="md"
colProps={{ span: 12 }}
options={[
{
label: '是',
value: true,
label: '引用令牌(不透明)',
value: 'reference',
},
{
label: '否',
value: false,
label: '自包含令牌(jwt)',
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>
</ModalForm>
);
@@ -118,17 +118,11 @@ const TableList: React.FC = () => {
width: 40,
},
{
title: '支持ID令牌',
key: 'supportIdToken',
title: '令牌类型',
key: 'tokenFormat',
width: 40,
align: 'center',
renderText: (_, record) => (record.supportIdToken ? '是' : '否'),
},
{
title: 'ID时效',
dataIndex: 'idTokenValiditySeconds',
valueType: 'second',
width: 40,
renderText: (_, record) => (record.tokenFormat == 'reference' ? '引用令牌' : '自包含令牌'),
},
{
title: '操作',
@@ -56,6 +56,7 @@ const TableList: React.FC = () => {
{
title: 'token',
dataIndex: 'tokenValue',
width: 120,
},
{
title: '到期时间',
@@ -76,7 +76,7 @@ declare namespace SYSTEM {
refreshTokenValiditySeconds?: number;
resourceIds?: string;
scope?: string;
supportIdToken?: boolean;
tokenFormat?: string;
updateTime?: Date;
webServerRedirectUri?: string;
};