diff --git a/frontend/src/global/form-rules.ts b/frontend/src/global/form-rules.ts index c8be16ae9..e5969d998 100644 --- a/frontend/src/global/form-rules.ts +++ b/frontend/src/global/form-rules.ts @@ -174,11 +174,11 @@ const checkParamCommon = (rule: any, value: any, callback: any) => { const checkParamComplexity = (rule: any, value: any, callback: any) => { if (value === '' || typeof value === 'undefined' || value == null) { - callback(new Error(i18n.global.t('commons.rule.paramComplexity', ['.%@$!&~_']))); + callback(new Error(i18n.global.t('commons.rule.paramComplexity', ['.%@$!&~_-']))); } else { - const reg = /^[a-zA-Z0-9]{1}[a-zA-Z0-9.%@$!&~_]{5,29}$/; + const reg = /^[a-zA-Z0-9]{1}[a-zA-Z0-9.%@$!&~_-]{5,29}$/; if (!reg.test(value) && value !== '') { - callback(new Error(i18n.global.t('commons.rule.paramComplexity', ['.%@$!&~_']))); + callback(new Error(i18n.global.t('commons.rule.paramComplexity', ['.%@$!&~_-']))); } else { callback(); } diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 6822b38aa..a7d46adae 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -145,7 +145,8 @@ export default { ipErr: 'IP [{0}] format error, please check', numberRange: 'Number range: {0} - {1}', paramName: 'Support English, numbers, .- and _, length 2-30', - paramComplexity: 'Support English, numbers, {0}, length 6-30', + paramComplexity: + 'Support English, numbers, {0}, length 6-30,Special characters cannot be at the beginning and end', paramUrlAndPort: 'The format is http(s)://(domain name/ip):(port)', nginxDoc: 'Only supports English case, numbers, and .', appName: 'Support English, numbers, - and _, length 2-30, and cannot start and end with -_', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 9e48688ec..a23ea05cf 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -149,7 +149,7 @@ export default { ipErr: 'IP [{0}] 格式错误,请检查', numberRange: '数字范围: {0} - {1}', paramName: '支持英文、数字、.-和_,长度2-30', - paramComplexity: '支持英文、数字、{0},长度6-30', + paramComplexity: '支持英文、数字、{0},长度6-30,特殊字符不能在首尾', paramUrlAndPort: '格式为 http(s)://(域名/ip):(端口)', nginxDoc: '仅支持英文大小写,数字,和.', appName: '支持英文、数字、-和_,长度2-30,并且不能以-_开头和结尾',