创建编辑工作空间时校验特殊字符

This commit is contained in:
shiziyuan9527 2020-05-22 15:49:59 +08:00
parent 7421b4b89d
commit 9ec6dd2170
4 changed files with 10 additions and 1 deletions

View File

@ -438,7 +438,13 @@
rules: {
name: [
{required: true, message: this.$t('workspace.input_name'), trigger: 'blur'},
{min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'}
{min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'},
{
required: true,
pattern: /^(?!-)(?!.*?-$)[a-zA-Z0-9\u4e00-\u9fa5-]+$/,
message: this.$t('workspace.special_characters_are_not_supported'),
trigger: 'blur'
}
],
organizationId: [
{required: true, message: this.$t('organization.select_organization'), trigger: ['blur']}

View File

@ -102,6 +102,7 @@ export default {
'please_select_a_workspace_first': 'Please select a workspace first!',
'none': 'None Workspace',
'select': 'Select Workspace',
'special_characters_are_not_supported': 'Incorrect format (special characters are not supported and cannot end with \'-\')',
},
organization: {
'create': 'Create Organization',

View File

@ -101,6 +101,7 @@ export default {
'please_select_a_workspace_first': '请先选择工作空间!',
'none': '无工作空间',
'select': '选择工作空间',
'special_characters_are_not_supported': '格式错误(不支持特殊字符,且不能以\'-\'开头结尾)',
},
organization: {
'create': '创建组织',

View File

@ -93,6 +93,7 @@ export default {
'please_select_a_workspace_first': '請先選擇工作空間! ',
'none': '無工作空間',
'select': '選擇工作空間',
'special_characters_are_not_supported': '格式錯誤(不支持特殊字符,且不能以\'-\'開頭結尾)',
},
organization: {
'create': '創建組織',