From 9ec6dd21704f2d761e9280bcaeb052207c01e7c5 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Fri, 22 May 2020 15:49:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=BC=96=E8=BE=91=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E7=A9=BA=E9=97=B4=E6=97=B6=E6=A0=A1=E9=AA=8C=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/settings/system/SystemWorkspace.vue | 8 +++++++- frontend/src/i18n/en-US.js | 1 + frontend/src/i18n/zh-CN.js | 1 + frontend/src/i18n/zh-TW.js | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/business/components/settings/system/SystemWorkspace.vue b/frontend/src/business/components/settings/system/SystemWorkspace.vue index c53e676998..531d3f5a43 100644 --- a/frontend/src/business/components/settings/system/SystemWorkspace.vue +++ b/frontend/src/business/components/settings/system/SystemWorkspace.vue @@ -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']} diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 5eb64c3f81..868dbf50a1 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -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', diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 60e429c751..04c153b838 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -101,6 +101,7 @@ export default { 'please_select_a_workspace_first': '请先选择工作空间!', 'none': '无工作空间', 'select': '选择工作空间', + 'special_characters_are_not_supported': '格式错误(不支持特殊字符,且不能以\'-\'开头结尾)', }, organization: { 'create': '创建组织', diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index d094a32097..07ce2c373a 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -93,6 +93,7 @@ export default { 'please_select_a_workspace_first': '請先選擇工作空間! ', 'none': '無工作空間', 'select': '選擇工作空間', + 'special_characters_are_not_supported': '格式錯誤(不支持特殊字符,且不能以\'-\'開頭結尾)', }, organization: { 'create': '創建組織',