Browse Source

feat: 修改校验规则

pull/184/head
zhengkunwang223 2 years ago committed by ssongliu
parent
commit
40e5dfaa11
  1. 2
      frontend/src/global/form-rules.ts
  2. 2
      frontend/src/lang/modules/en.ts
  3. 4
      frontend/src/lang/modules/zh.ts

2
frontend/src/global/form-rules.ts

@ -150,7 +150,7 @@ const checkParamCommon = (rule: any, value: any, callback: any) => {
if (value === '' || typeof value === 'undefined' || value == null) {
callback(new Error(i18n.global.t('commons.rule.paramName')));
} else {
const reg = /^[a-zA-Z0-9]{1}[a-zA-Z0-9._-]{6,30}$/;
const reg = /^[a-zA-Z0-9]{1}[a-zA-Z0-9._-]{2,30}$/;
if (!reg.test(value) && value !== '') {
callback(new Error(i18n.global.t('commons.rule.paramName')));
} else {

2
frontend/src/lang/modules/en.ts

@ -136,7 +136,7 @@ export default {
domain: 'domain name format error',
databaseName: 'Support English, numbers, _, length 1-30',
ipErr: 'IP [{0}] format error, please check',
paramName: 'Support English, numbers, .- and _, length 6-30',
paramName: 'Support English, numbers, .- and _, length 2-30',
paramComplexity: 'Support English, numbers, {0}, length 6-30',
},
res: {

4
frontend/src/lang/modules/zh.ts

@ -141,7 +141,7 @@ export default {
domain: '域名格式错误',
databaseName: '支持英文数字_,长度1-30',
ipErr: 'IP [{0}] 格式错误,请检查',
paramName: '支持英文数字.-和_,长度6-30',
paramName: '支持英文数字.-和_,长度2-30',
paramComplexity: '支持英文数字{0},长度6-30',
paramUrlAndPort: '格式为 http(s)://(域名/ip):(端口)',
},
@ -865,7 +865,7 @@ export default {
installed: '已安装',
all: '全部',
version: '版本',
detail: '应用详情',
detail: '参数',
install: '安装',
author: '作者',
source: '来源',

Loading…
Cancel
Save