diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/createTenement.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/createTenement.vue index 213109d776..a26862a9b5 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/createTenement.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/createTenement.vue @@ -133,15 +133,14 @@ }, _verification () { let isEn = /^[0-9a-zA-Z_.-]{1,}$/ - let isNumber = /^\d+$/ - let isComb =/^[0-9a-zA-Z]*$/g - if(!isComb.test(this.tenantCode)) { - this.$message.warning(`${i18n.$t('The tenant code. Only letters or a combination of letters and numbers are allowed')}`) + if (!this.tenantCode.replace(/\s*/g,"")) { + this.$message.warning(`${i18n.$t('Please enter the tenant code in English')}`) return false } - if(isNumber.test(this.tenantCode)) { - this.$message.warning(`${i18n.$t('The tenant code. Only letters or a combination of letters and numbers are allowed')}`) + + if (!isEn.test(this.tenantCode) || _.startsWith(this.tenantCode, '_', 0) || _.startsWith(this.tenantCode, '.', 0)) { + this.$message.warning(`${i18n.$t('Please enter tenant code in English')}`) return false } diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js index 2680af1a36..835ffc7faf 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js @@ -173,6 +173,8 @@ export default { 'Tenant Name': 'Tenant Name', Queue: 'Queue', 'Please select a queue': 'default is tenant association queue', + 'Please enter the tenant code in English': 'Please enter the tenant code in English', + 'Please enter tenant code in English': 'Please enter tenant code in English', 'Please enter tenant code': 'Please enter tenant code', 'Please enter tenant Name': 'Please enter tenant Name', 'The tenant code. Only letters or a combination of letters and numbers are allowed': 'The tenant code. Only letters or a combination of letters and numbers are allowed', @@ -342,6 +344,7 @@ export default { 'Drag the file into the current upload window': 'Drag the file into the current upload window', 'Drag area upload': 'Drag area upload', Upload: 'Upload', + 'ReUpload File': 'Re-upload file', 'Please enter file name': 'Please enter file name', 'Please select the file to upload': 'Please select the file to upload', 'Resources manage': 'Resources', diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js index 131c2604e4..c672c41585 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js @@ -176,6 +176,8 @@ export default { 'Tenant Code': '租户编码', 'Tenant Name': '租户名称', Queue: '队列', + 'Please enter the tenant code in English': '请输入租户编码只允许英文', + 'Please enter tenant code in English': '请输入英文租户编码', 'Please enter tenant code': '请输入租户编码', 'Please enter tenant Name': '请输入租户名称', 'The tenant code. Only letters or a combination of letters and numbers are allowed': '租户编码只允许字母或字母与数字组合',