1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

fix: 限制数据库名称大小写 (#1899)

This commit is contained in:
ssongliu 2023-08-10 10:36:20 +08:00 committed by GitHub
parent 018fb85bc3
commit b1f817f09b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -137,7 +137,7 @@ const checkDBName = (rule: any, value: any, callback: any) => {
if (value === '' || typeof value === 'undefined' || value == null) { if (value === '' || typeof value === 'undefined' || value == null) {
callback(new Error(i18n.global.t('commons.rule.dbName'))); callback(new Error(i18n.global.t('commons.rule.dbName')));
} else { } else {
const reg = /^[a-zA-Z0-9\u4e00-\u9fa5]{1}[a-zA-Z0-9_.\u4e00-\u9fa5-]{0,64}$/; const reg = /^[a-z0-9\u4e00-\u9fa5]{1}[a-z0-9_.\u4e00-\u9fa5-]{0,64}$/;
if (!reg.test(value) && value !== '') { if (!reg.test(value) && value !== '') {
callback(new Error(i18n.global.t('commons.rule.dbName'))); callback(new Error(i18n.global.t('commons.rule.dbName')));
} else { } else {

View File

@ -154,7 +154,7 @@ const message = {
commonName: 'Support English, Chinese, numbers, .-, and _ length 1-30', commonName: 'Support English, Chinese, numbers, .-, and _ length 1-30',
userName: 'Support English, Chinese, numbers and _ length 3-30', userName: 'Support English, Chinese, numbers and _ length 3-30',
simpleName: 'Support English, numbers and _ length 1-30', simpleName: 'Support English, numbers and _ length 1-30',
dbName: 'Support English, Chinese, numbers, .-, and _ length 1-64', dbName: 'Support lowercase letters, Chinese, numbers, .-, and _ length 1-64',
imageName: 'Support English, numbers, :/.-_, length 1-150', imageName: 'Support English, numbers, :/.-_, length 1-150',
volumeName: 'Support English, numbers, .-_, length 2-30', volumeName: 'Support English, numbers, .-_, length 2-30',
complexityPassword: complexityPassword:

View File

@ -155,7 +155,7 @@ const message = {
commonName: '支持英文中文數字.-和_,長度1-30', commonName: '支持英文中文數字.-和_,長度1-30',
userName: '支持英文中文數字和_,長度3-30', userName: '支持英文中文數字和_,長度3-30',
simpleName: '支持英文數字_,長度1-30', simpleName: '支持英文數字_,長度1-30',
dbName: '支持英文中文數字.-_,長度1-64', dbName: '支持小寫字母中文數字.-_,長度1-64',
imageName: '支持英文數字:/.-_,長度1-150', imageName: '支持英文數字:/.-_,長度1-150',
volumeName: '支持英文數字.-和_,長度2-30', volumeName: '支持英文數字.-和_,長度2-30',
complexityPassword: '請輸入長度大於 8 位且包含字母數字特殊字符至少兩項的密碼組合', complexityPassword: '請輸入長度大於 8 位且包含字母數字特殊字符至少兩項的密碼組合',

View File

@ -155,7 +155,7 @@ const message = {
commonName: '支持英文中文数字.-和_,长度1-30', commonName: '支持英文中文数字.-和_,长度1-30',
userName: '支持英文中文数字和_,长度3-30', userName: '支持英文中文数字和_,长度3-30',
simpleName: '支持英文数字_,长度1-30', simpleName: '支持英文数字_,长度1-30',
dbName: '支持英文中文数字.-_,长度1-64', dbName: '支持小写字母中文数字.-_,长度1-64',
imageName: '支持英文数字:/.-_,长度1-150', imageName: '支持英文数字:/.-_,长度1-150',
volumeName: '支持英文数字.-和_,长度2-30', volumeName: '支持英文数字.-和_,长度2-30',
complexityPassword: '请输入长度大于 8 位且包含字母数字特殊字符至少两项的密码组合', complexityPassword: '请输入长度大于 8 位且包含字母数字特殊字符至少两项的密码组合',