|
|
@@ -31,6 +31,7 @@ import { useHistory, useLocation } from '@/hooks';
|
|
|
import { getMenuPathByCode } from '@/utils/menu';
|
|
|
import MenuPage from '../Menu';
|
|
|
import _ from 'lodash';
|
|
|
+import { UploadImage } from '@/components';
|
|
|
|
|
|
const Save = () => {
|
|
|
const location = useLocation();
|
|
|
@@ -133,6 +134,7 @@ const Save = () => {
|
|
|
TreeSelect,
|
|
|
ArrayTable,
|
|
|
AutoComplete,
|
|
|
+ UploadImage,
|
|
|
},
|
|
|
});
|
|
|
|
|
|
@@ -237,13 +239,35 @@ const Save = () => {
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
- onFieldReact('apiClient.authConfig.oauth2.clientId', (filed) => {
|
|
|
+ onFieldReact('apiClient.authConfig.oauth2.clientId', (field) => {
|
|
|
if (id && accessRef.current?.includes('apiClient')) {
|
|
|
- filed.componentProps = {
|
|
|
+ field.componentProps = {
|
|
|
disabled: true,
|
|
|
};
|
|
|
}
|
|
|
});
|
|
|
+ onFieldReact('apiServer.ipWhiteList', (field: any) => {
|
|
|
+ const value = (field as Field).value;
|
|
|
+ console.log(value);
|
|
|
+ const pattern =
|
|
|
+ /((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/;
|
|
|
+ if (value) {
|
|
|
+ const str = value?.split(/[\n,]/g).filter((i: any) => i && i.trim());
|
|
|
+ console.log(str);
|
|
|
+ str.forEach((item: any) => {
|
|
|
+ const ip = pattern.test(item);
|
|
|
+ console.log(ip);
|
|
|
+ if (!ip) {
|
|
|
+ field.selfErrors = `[${item}]不是正确的IP地址`;
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ field.selfErrors = '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ field.selfErrors = '';
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
});
|
|
|
|
|
|
@@ -461,6 +485,16 @@ const Save = () => {
|
|
|
'x-component-props': {
|
|
|
placeholder: '请输入appId',
|
|
|
},
|
|
|
+ 'x-validator': [
|
|
|
+ {
|
|
|
+ max: 64,
|
|
|
+ message: '最多可输入64个字符',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入appId',
|
|
|
+ },
|
|
|
+ ],
|
|
|
'x-reactions': {
|
|
|
dependencies: ['provider'],
|
|
|
fulfill: {
|
|
|
@@ -484,6 +518,16 @@ const Save = () => {
|
|
|
'x-component-props': {
|
|
|
placeholder: '请输入appSecret',
|
|
|
},
|
|
|
+ 'x-validator': [
|
|
|
+ {
|
|
|
+ max: 64,
|
|
|
+ message: '最多可输入64个字符',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入appSecret',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
'sso.autoCreateUser': {
|
|
|
type: 'string',
|
|
|
@@ -530,6 +574,16 @@ const Save = () => {
|
|
|
'x-component-props': {
|
|
|
placeholder: '请输入scope',
|
|
|
},
|
|
|
+ 'x-validator': [
|
|
|
+ {
|
|
|
+ max: 64,
|
|
|
+ message: '最多可输入64个字符',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入scope',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
'sso.configuration.oauth2.clientId': {
|
|
|
type: 'string',
|
|
|
@@ -545,6 +599,16 @@ const Save = () => {
|
|
|
'x-component-props': {
|
|
|
placeholder: '请输入client_id',
|
|
|
},
|
|
|
+ 'x-validator': [
|
|
|
+ {
|
|
|
+ max: 64,
|
|
|
+ message: '最多可输入64个字符',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入client_id',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
'sso.configuration.oauth2.clientSecret': {
|
|
|
type: 'string',
|
|
|
@@ -560,6 +624,16 @@ const Save = () => {
|
|
|
'x-component-props': {
|
|
|
placeholder: '请输入client_secret',
|
|
|
},
|
|
|
+ 'x-validator': [
|
|
|
+ {
|
|
|
+ max: 64,
|
|
|
+ message: '最多可输入64个字符',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入client_secret',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
'sso.configuration.oauth2.authorizationUrl': {
|
|
|
type: 'string',
|
|
|
@@ -591,6 +665,17 @@ const Save = () => {
|
|
|
placeholder: '请输入token地址',
|
|
|
},
|
|
|
},
|
|
|
+ 'sso.configuration.oauth2.logoUrl': {
|
|
|
+ type: 'string',
|
|
|
+ title: 'logo',
|
|
|
+ 'x-decorator': 'FormItem',
|
|
|
+ 'x-decorator-props': {
|
|
|
+ gridSpan: 2,
|
|
|
+ layout: 'vertical',
|
|
|
+ labelAlign: 'left',
|
|
|
+ },
|
|
|
+ 'x-component': 'UploadImage',
|
|
|
+ },
|
|
|
'sso.configuration.oauth2.userInfoUrl': {
|
|
|
type: 'string',
|
|
|
title: '用户信息地址',
|
|
|
@@ -749,6 +834,16 @@ const Save = () => {
|
|
|
'x-component-props': {
|
|
|
placeholder: '请输入appId',
|
|
|
},
|
|
|
+ 'x-validator': [
|
|
|
+ {
|
|
|
+ max: 64,
|
|
|
+ message: '最多可输入64个字符',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入appId',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
'apiClient.authConfig.oauth2.clientSecret': {
|
|
|
type: 'string',
|
|
|
@@ -764,6 +859,16 @@ const Save = () => {
|
|
|
'x-component-props': {
|
|
|
placeholder: '请输入appKey',
|
|
|
},
|
|
|
+ 'x-validator': [
|
|
|
+ {
|
|
|
+ max: 64,
|
|
|
+ message: '最多可输入64个字符',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入appKey',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
} as any;
|
|
|
//第三方平台-客户端
|
|
|
@@ -1093,6 +1198,16 @@ const Save = () => {
|
|
|
'x-component-props': {
|
|
|
placeholder: '请输入secureKey',
|
|
|
},
|
|
|
+ 'x-validator': [
|
|
|
+ {
|
|
|
+ max: 64,
|
|
|
+ message: '最多可输入64个字符',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入secureKey',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
'apiServer.redirectUri': {
|
|
|
type: 'string',
|
|
|
@@ -1533,7 +1648,7 @@ const Save = () => {
|
|
|
type: 'void',
|
|
|
// required: true,
|
|
|
'x-component': 'ArrayTable.Column',
|
|
|
- 'x-component-props': { width: 100, title: 'key' },
|
|
|
+ 'x-component-props': { width: 100, title: 'KEY' },
|
|
|
properties: {
|
|
|
key: {
|
|
|
// required: true,
|
|
|
@@ -1545,7 +1660,7 @@ const Save = () => {
|
|
|
column2: {
|
|
|
type: 'void',
|
|
|
'x-component': 'ArrayTable.Column',
|
|
|
- 'x-component-props': { width: 100, title: 'value' },
|
|
|
+ 'x-component-props': { width: 100, title: 'VALUE' },
|
|
|
properties: {
|
|
|
value: {
|
|
|
// required: true,
|
|
|
@@ -1574,7 +1689,7 @@ const Save = () => {
|
|
|
add: {
|
|
|
type: 'void',
|
|
|
'x-component': 'ArrayTable.Addition',
|
|
|
- title: '添加参数',
|
|
|
+ title: '新增',
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
@@ -1670,6 +1785,16 @@ const Save = () => {
|
|
|
'x-component-props': {
|
|
|
placeholder: '请输入默认密码',
|
|
|
},
|
|
|
+ 'x-validator': [
|
|
|
+ {
|
|
|
+ max: 64,
|
|
|
+ message: '最多可输入64个字符',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入默认密码',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
'sso.roleIdList': {
|
|
|
title: '角色',
|