feat: 数据库密码增加限制

This commit is contained in:
zhengkunwang223 2023-03-10 15:34:26 +08:00 committed by zhengkunwang223
parent ddd59cd5f4
commit b27f42df58
3 changed files with 6 additions and 5 deletions

View File

@ -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();
}

View File

@ -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 -_',

View File

@ -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,并且不能以-_开头和结尾',